cybmatrix wrote: ↑Mon Sep 09, 2019 3:36 pm
And what about the javascript solution instead ?
Foxyproxy source code. This feature currently can only be used from an XUL extension using the XPCOM API (e.g. waterfox 56, PaleMoon/Basilisk, old firefox). Firefox 45 and higher supports SOCKS proxies with authentication. Before that, SOCKS is supported but not with authentication.
I think it's usable in imacros 8.9.7 with javascript.
1. HTTP/HTTPS Proxy (with authentication)
Easier than socks5 proxy in my eyes like observer with "http-on-modify-request" with username and password. Set proxy and header modification with "Proxy-Authorizationn" + "Basic USER:PASS". USER:PASS is in Base64 required (e.g. in the source code
Proxy Authentication #1 #2 => chrome => content => overlay.js).
See
https://developer.mozilla.org/en-US/doc ... horization and
https://developer.mozilla.org/en-US/doc ... entication
Or you can try
https://stackoverflow.com/questions/637 ... -extension but I think it's only for http authentication.
2. Socks4/5 proxy (with authentication)
Solution is in
Foxyproxy. I have not enough time to research it in the addon source code.
It's tricky (e.g. set isHttps to false, isSocks to true) but helpful are lines like (foxyproxy 4.6.5 => components => proxy.js):
var proxyService = CC["@mozilla.org/network/protocol-proxy-service;1"].getService(CI.nsIProtocolProxyService),
proxyService.newProxyInfoWithAuth(this._socksversion == "5" ? "socks" : "socks4", this._host, this._port, this.username, this.password, this.owner._proxyDNS ? CI.nsIProxyInfo.TRANSPARENT_PROXY_RESOLVES_HOST : 0, 0, null);
See
https://developer.mozilla.org/en-US/doc ... oxyService
source/toolkit/components/extensions/ProxyScriptContext.jsm:
newProxyInfoWithAuth:
type,
host,
port,
username,
password,
proxyAuthorizationHeader,
connectionIsolationKey,
proxyDNS ? TRANSPARENT_PROXY_RESOLVES_HOST : 0,
failoverTimeout ? failoverTimeout : PROXY_TIMEOUT_SEC,
failoverProxy
Untested (except foxyproxy?) and no documentation in my eyes.
3. Use foyproxy in your addons (e.g.imacros 8.9.7)
Easiest way is the protocol handler with your addressbar (url goto):
https://getfoxyproxy.org/developers/proxyprotocol/ (with geoip check page under
https://getfoxyproxy.org/geoip/)
Release notes:
https://help.getfoxyproxy.org/index.php ... r-firefox/ ("support of proxy authentication credentials" since 2013/v4.2+)
Example without JavaScript and Foxyproxy (v4.6.5):
proxy:host=foo.tld&port=999&enabled=true&proxyDNS=false&password=foobar&username=foouser&foxyProxyMode=this&mode=manual&socksversion=5&isSocks=true
My test script with pure IIM (with ccproxy free as proxy software with socks5 under Windows):
Code: Select all
TAB T=1
URL GOTO=proxy:host=foo.tld&port=999&enabled=true&proxyDNS=false&username=foouser&password=foobar&foxyProxyMode=this&mode=manual&socksversion=5&isSocks=true
URL GOTO=https://getfoxyproxy.org/geoip/
URL GOTO=proxy:host=foo.tld&port=999&enabled=true&proxyDNS=false&username=foouser&password=foobar&foxyProxyMode=this&mode=manual&socksversion=5&isSocks=true&action=delete
It works very fast and very good in my tests. No delays in my tests.
But it's tricky with iMacros without Button "Allow" for every foxyproxy api call.
Download the original XPI File (v4.6.5), rename xpi to zip and use winrar (update the zip file, don't create a new zip file!).
1. File components/common.js
Search:
Code: Select all
notify : function(msg, ar, buttons, priority, callback, getNotWithVal, callbackArgs) {
Replace it with this code:
Code: Select all
notify : function(msg, ar, buttons, priority, callback, getNotWithVal, callbackArgs) {
return callback(callbackArgs);
2. File components/proxy.js
Search:
Code: Select all
if (this.username && this.password && this.fp.isGecko45 && this._socksversion == "5") {
Replace it:
Code: Select all
if (this.username && this.password && this._socksversion == "5") {
Rename it back from zip to xpi and try it.
NOTE: If you have foxyproxy already installed then deinstall it OR delete the folder foxyproxy* under "extensions" in your profile directory (and restart your browser)!
Or you can use the xpi file in the attachment (4 rar archive, 3 in this post and 1 in the next post). Tested with Basilisk Browser 2019.09.03 (64-bit), Win8.1 (x64) and iMacros v8.9.7