Changeset eae86f5 for apps/proxyscript
- Timestamp:
- Sep 8, 2004 7:25:09 AM (16 years ago)
- Branches:
- master
- Children:
- 8e63974
- Parents:
- 30128a1
- git-author:
- hypercubus <hypercubus> (09/08/04 07:25:09)
- git-committer:
- zzz <zzz@…> (09/08/04 07:25:09)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/proxyscript/i2pProxy.pac
r30128a1 reae86f5 6 6 ** Date: 11 May 2004 7 7 ** 8 ** Revised: 07 Sep 2004 9 ** Changes: 10 ** Proxy recursion disabled by default (strict) 11 ** Password Authentication for session commands 12 ** Support for http://path?i2paddresshelper=BASE64 13 ** Support for http://i2p/BASE64/path syntax 8 14 ** Revised: 17 May 2004 9 ** Added:15 ** Changes: 10 16 ** Ability for the user to control the proxy 11 17 ** status on a per browser-session basis. 12 18 ********************************************************/ 19 13 20 14 21 /* C O N F I G U R A T I O N … … 54 61 ** eg. <img src="i2p.off" ... 55 62 ** This is why the default setting for statusKeyword is "limited", which only 56 ** allows you to set the proxy status to "on". 63 ** allows you to set the proxy status to "on". See also keywordAuthPassword. 57 64 ** 58 65 ** [1] "all" => All proxy status urls are available. 59 66 ** '-> i2p.on, i2p.off, i2p.auto (respective to proxyStatus settings) 60 67 ** '-> WARNING: Setting "all" is a big risk to your anonymity! 61 ** 68 ** '-> In this mode it is highly recommended you set an AuthPassword too! 69 ** 62 70 ** [2] "limited" => Only i2p.on is available.. 63 71 ** '-> This setting lasts for the duration of the browser setting. … … 71 79 */ 72 80 73 var statusKeyword = " limited";81 var statusKeyword = "all"; 74 82 75 83 /* … … 85 93 */ 86 94 87 var strict = false; 95 var strict = true; 96 97 /* 98 ** By setting an authentication password, all activated session keywords 99 ** will require the addition of a password to prevent malicious sites from 100 ** hijacking your proxy settings. ie. <img src="i2p.off" ... 101 ** Users should append whatever they set here to any command keywords 102 ** they use. 103 ** eg. i2p.on.passw0rd 104 ** If left blank, authentication is ignored - it is recommended that 105 ** you use "limited" statusKeyword mode if you choose not to require a password. 106 ** If you do require this feature then you should replace the default "passw0rd" with 107 ** one of your own (recommend at least 8 letters with a case-sensitive alpha-numeric 108 ** mix of characters). 109 ** 110 */ 111 112 var keywordAuthPassword = "passw0rd"; 88 113 89 114 … … 97 122 98 123 if (strict == false) { 99 i2pProxy = i2pProxy + "; " + normal; 124 i2pProxy = i2pProxy + "; " + normal; 125 } 126 127 /*Check for User Authentication Password. 128 */ 129 if (keywordAuthPassword != "") { 130 keywordAuthPassword = "." + keywordAuthPassword; 100 131 } 101 132 … … 109 140 110 141 if (statusKeyword != "off") { 111 if (host == "i2p.off" && statusKeyword == "all") {142 if (host == "i2p.off" + keywordAuthPassword && statusKeyword == "all") { 112 143 /*Proxy is bypassed - outweb available only 113 144 */ 114 145 proxyStatus = "off"; 115 } else if (host == "i2p.auto" && statusKeyword == "all") {146 } else if (host == "i2p.auto" + keywordAuthPassword && statusKeyword == "all") { 116 147 /* Proxy is used only for .i2p hosts otherwise 117 148 ** '-> browse as normal. 118 149 */ 119 150 proxyStatus = "auto"; 120 } else if (host == "i2p.on" && statusKeyword == "limited") { 151 } else if (host == "i2p.on" + keywordAuthPassword && (statusKeyword == "limited" || 152 statusKeyword == "all" )) { 121 153 /* Only I2P traffic is accepted. 122 154 */ … … 136 168 137 169 host = host.toLowerCase(); 138 /* check tld for "i2p" - if found then redirect170 /* check tld for "i2p" or oOo's new "i2paddresshelper" syntax - if found then redirect 139 171 ** '-> request to the i2p proxy 140 172 */ 141 173 142 if (shExpMatch(host, "*.i2p")) { // seems more reliable than: 143 return i2pProxy; // dnsDomainIs(host, ".i2p") || 144 } else { // i2pRegex.test(host) 174 if (url.match(/^http:\/\/i2p\/[a-zA-Z0-9\-\~]{516}|i2paddresshelper=/i) || 175 shExpMatch(host, "*.i2p")) { // seems more reliable than: 176 return i2pProxy; // dnsDomainIs(host, ".i2p") || 177 } else { // i2pRegex.test(host) 145 178 return normal; 146 179 }
Note: See TracChangeset
for help on using the changeset viewer.