mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
Add compatible PAC result for SOCKS5 in Safari. Fix #391.
This commit is contained in:
parent
9d91588dbb
commit
a9c85e00a2
@ -62,7 +62,10 @@ module.exports = exports =
|
||||
|
||||
pacResult: (proxy) ->
|
||||
if proxy
|
||||
"#{exports.pacProtocols[proxy.scheme]} #{proxy.host}:#{proxy.port}"
|
||||
if proxy.scheme == 'socks5'
|
||||
"SOCKS5 #{proxy.host}:#{proxy.port}; SOCKS #{proxy.host}:#{proxy.port}"
|
||||
else
|
||||
"#{exports.pacProtocols[proxy.scheme]} #{proxy.host}:#{proxy.port}"
|
||||
else
|
||||
'DIRECT'
|
||||
|
||||
|
@ -46,6 +46,10 @@ describe 'Profiles', ->
|
||||
it 'should return a valid PAC result for a proxy', ->
|
||||
proxy = {scheme: "http", host: "127.0.0.1", port: 8888}
|
||||
Profiles.pacResult(proxy).should.equal("PROXY 127.0.0.1:8888")
|
||||
it 'should return special compatible result for SOCKS5', ->
|
||||
proxy = {scheme: "socks5", host: "127.0.0.1", port: 8888}
|
||||
compatibleResult = "SOCKS5 127.0.0.1:8888; SOCKS 127.0.0.1:8888"
|
||||
Profiles.pacResult(proxy).should.equal(compatibleResult)
|
||||
describe '#byName', ->
|
||||
it 'should get profiles from builtin profiles', ->
|
||||
profile = Profiles.byName('direct')
|
||||
|
Loading…
Reference in New Issue
Block a user