-
Notifications
You must be signed in to change notification settings - Fork 0
/
proxy.js
31 lines (28 loc) · 856 Bytes
/
proxy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function FindProxyForURL (url, host) {
var proxy='SOCKS localhost:1080';
var domains = [
// Mines URLS get proxied
'.mines.edu',
// Proxy publication sites to get Mines access
'scholar.google.com',
'ieeexplore.ieee.org',
'sciencedirect.com',
'onlinelibrary.wiley.com',
'dl.acm.org',
'journals.sagepub.com',
'link.springer.com',
'science.org',
'nature.com',
'cambridge.org'
];
// No proxy on Mines IP addresses
// Mines subnets from AS36704 (https://bgpview.io/asn/36704#prefixes-v4)
if (isInNet(myIpAddress(), "138.67.0.0", "255.255.0.0")) {
return 'DIRECT';
}
if (domains.find( domain => dnsDomainIs(host, domain))) {
return proxy;
}
// Don't proxy the whole intarwebs
return 'DIRECT';
}