Skip to content

Commit

Permalink
v8.9
Browse files Browse the repository at this point in the history
  • Loading branch information
erosman authored Jan 29, 2024
1 parent 063c516 commit db48974
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 30 deletions.
1 change: 1 addition & 0 deletions src/content/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ <h2 id="changelog">Changelog</h2>
<dd>Fixed proxy DNS in "Import Proxy List" (#102) (from 8.7)</dd>
<dd>Fixed settings upgrade (import older) when hostname is missing (#108)</dd>
<dd>Fixed settings upgrade (import older) when username/password is missing (#103)</dd>
<dd>Fixed socks in "Import Proxy List" on some Firefox (#120)</dd>
<dd>Increased log content</dd>
<dd>Removed "Show Pattern Proxy" option and made it default (#57) (from 8.7) (Firefox only)</dd>
<dd>Removed Tab Proxy page-action and set it to the toolbar icon (#114) (Firefox only)</dd>
Expand Down
6 changes: 5 additions & 1 deletion src/content/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -712,14 +712,18 @@ <h3 id="save">Save</h3>
<h2 id="proxies">Proxies</h2>

<p>FoxyProxy identifies proxies by their "hostname:post" or PAC URL.</p>

<p>In case more than one proxy with the same "hostname:post" is needed, one or more letters can be added to the port to separate them, and FoxyProxy will remove the letters later. <i>(v8.8)</i></p>

<pre>
127.0.0.1:9050
127.0.0.1:9050a
127.0.0.1:9050b
127.0.0.1:9050c
</pre>
<p class="warning">For Unix Domain Sockets, where port is ignored, only numbers should be used.</p>

<p class="warning">The augmented port method is only only available for SOCKS & HTTPS (not HTTP, due to the limitation of the Firefox API). <br>
For Unix Domain Sockets, where port is ignored, only numbers should be used.</p>

<p>Another solution is to prepend hostnames where possible e.g. <code>&lt;sometext&gt;.localhost</code> since they all resolve to <code>127.0.0.1</code> internally.</p>

Expand Down
2 changes: 1 addition & 1 deletion src/content/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -654,4 +654,4 @@

</article>
</body>
</html>
</html>
47 changes: 19 additions & 28 deletions src/content/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,6 @@ class ImportProxyList {
static parseExtended(item) {
// https://user:[email protected]:21?color=ff00bc&title=work%20proxy
// https://example.com:443?active=false&title=Work&username=abcd&password=1234&cc=US&city=Miami

// convert old schemes to type
let url;
try { url = new URL(item); }
catch (error) {
Expand All @@ -1026,19 +1024,18 @@ class ImportProxyList {

// convert old schemes to type
let type = url.protocol.slice(0, -1);
if (!['http', 'https'].includes(type)) {
const scheme = {
proxy: 'http',
ssl: 'https',
socks4: 'socks4',
socks5: 'socks5',
socks: 'socks5',
};

scheme[type] && (type = scheme[type]);
url.protocol = 'http:';
url = new URL(url);
}
const scheme = {
proxy: 'http',
ssl: 'https',
socks: 'socks5',
};
scheme[type] && (type = scheme[type]);
// https://bugzilla.mozilla.org/show_bug.cgi?id=1851426
// Reland URL: protocol setter needs to be more restrictive around file (fixed in Firefox 120)
// https://bugzilla.mozilla.org/show_bug.cgi?id=1603699
// Enable DefaultURI use for unknown schemes (fixed in Firefox 122)
// missing hostname, port with socks protocol (#120)
!url.hostname && (url = new URL('http:' + item.substring(url.protocol.length)));

const {hostname, port, username, password} = url;
// set to pram, can be overridden in searchParams
Expand All @@ -1050,19 +1047,13 @@ class ImportProxyList {
}

// fix missing default port
if (!pram.port) {
switch (type) {
case 'http':
case 'ws':
pram.port = '80';
break;

case 'https':
case 'wss':
pram.port = '443';
break;
}
}
const defaultPort = {
http: '80',
https: '443',
ws: '80',
wss: '443'
};
!pram.port && defaultPort[type] && (pram.port = defaultPort[type]);

// proxy template
const pxy = {
Expand Down

0 comments on commit db48974

Please sign in to comment.