如何使用NetworkExtension创建sock5代理服务器

时间:2019-04-14 13:49:39

标签: ios swift proxy networkextension

我正在尝试通过NetworkExtension在我的ios应用程序中创建本地sock5代理服务器,但是我找不到任何简单的代码,如何使用它。

let networkSettings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "host")
        networkSettings.mtu = 1500

        let ipv4Settings = NEIPv4Settings(addresses: [""], subnetMasks: [""])

        networkSettings.ipv4Settings = ipv4Settings

        let proxySettings = NEProxySettings()
        proxySettings.httpEnabled = true
        proxySettings.httpServer = NEProxyServer(address: "127.0.0.1", port: proxyPort)
        proxySettings.httpsEnabled = true
        proxySettings.httpsServer = NEProxyServer(address: "127.0.0.1", port: proxyPort)

这是关于我尝试过的Http代理服务器,我找不到sock5代理设置。我该怎么办?

0 个答案:

没有答案