This code works fine on macOS, but not working on Windows. Actually, the URLSession will automatically use the System proxy configuration by default on Mac. But on Windows it seems like nothing effect.
let conf = URLSessionConfiguration.default
conf.connectionProxyDictionary = [
"SOCKSEnable": 1,
"SOCKSProxy": "127.0.0.1",
"SOCKSPort": 10808
]
let session = URLSession(configuration: conf)
I wanted to debug some code on windows and saw that there is no support for proxy.
...
Looking at the latest swift-corelibs-foundation commit ad782e213d222400e0402c411e327dc8822f54bb
It's highly unlikely swift-corelibs-foundation sees any major changes, as all work is going into swift-foundation. Our only hope is either a port of URLSession to swift-foundation, or a new Swift networking library altogether.
Oh my bad, I thought this code was on swift-corelibs-foundation
So what code is used by the 6.1 tool chain release ?
...
I see that FoundationNetworking is declared on swift-corelibs-foundation
Which imports swift-foundation
So the swift code for platforms like Windows appears to be on swift-corelibs-foundation
such as ../swift-corelibs-foundation/Sources/FoundationNetworking/URLSession/URLSession.swift