当前位置:首页>帮助中心>雷神HTTP—iOS 使用socks5代理服务器

雷神HTTP—iOS 使用socks5代理服务器

发布日期:2020-06-18 09:32:26 来源:雷神HTTP

iOS 使用socks5代理服务器需要配置URLSessionConfiguration,如下:

let dict: [String:Any] = [kCFStreamPropertySOCKSProxyPort as String: 9180,  kCFStreamPropertySOCKSProxyHost as String: "127.0.0.1"]let configuration = URLSessionConfiguration.ephemeral
configuration.connectionProxyDictionary = dictlet session = URLSession(configuration: configuration)let task = session.dataTask(with: URL(string: "http://httpbin.org/get")!){
    data, response, error in print(response ?? "")}task.resume()



用户登录

自动登录 忘记密码?

还没帐号?立即注册

用户注册

图形验证码

短信获取

我已阅读并同意 《用户协议》

已有账号?立即登录

忘记密码

图形验证码

短信获取

返回登录