How to use URLSession with Proxy in Swift 3

前端 未结 2 1722
庸人自扰
庸人自扰 2020-12-31 05:39

For an API Request I\'m trying to setup an URLSession using a Proxy. For test purposes I\'m using a public Proxy and an API responding the IP.

func makeReque         


        
2条回答
  •  被撕碎了的回忆
    2020-12-31 06:12

    I am not sure if that make sense. But, there is two defferent set of keys here:

    1. HTTP
    2. HTTPS

    Proxy Keys:

    // http proxy keys
    kCFNetworkProxiesHTTPEnable
    kCFNetworkProxiesHTTPProxy
    kCFNetworkProxiesHTTPPort
    
    // https proxy keys
    kCFNetworkProxiesHTTPSEnable
    kCFNetworkProxiesHTTPSProxy
    kCFNetworkProxiesHTTPSPort
    

提交回复
热议问题