bbbb
V2EX  ›  iOS

迫于查询无果: iOS 开发中 WKWebView websocket 可以设置 HTTP Basic-Auth 吗?

  •  
  •   bbbb · Dec 3, 2021 · 1450 views
    This topic created in 1628 days ago, the information mentioned may be changed or developed.

    这样设置了 http 的,但是 websocket 的没设置上,有做过相关的 v 友吗?

    NSURLCredential *creds = [[NSURLCredential alloc] initWithUser:@"user" password:@"pwd" persistence:NSURLCredentialPersistenceForSession];
    
    2 replies    2021-12-23 15:46:07 +08:00
    chenzheyu
        1
    chenzheyu  
       Dec 23, 2021
    虽然我不懂 ws ,但是 BasicAuth 在 http 上面就是一个 header Authorization: Basic MTIzMjEzOjEyMzIxMw==
    bbbb
        2
    bbbb  
    OP
       Dec 23, 2021
    @chenzheyu 嗯,这个我知道,在 WKWebView websocket 里面还不知道如何设置,我把 websocket 的认证取消了,其他的保留,暂时算解决了我的问题,有时间我研究一下怎么回事。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5068 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 09:20 · PVG 17:20 · LAX 02:20 · JFK 05:20
    ♥ Do have faith in what you're doing.