Change sock5 proxy?

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Pucca
Posts: 8
Joined: Fri Jan 15, 2016 10:31 am

Change sock5 proxy?

Post by Pucca » Wed May 30, 2018 3:04 am

Does anyone know a way to change the sock5 proxy? I only found a method to change HTTP proxy

Code: Select all

PROXY ADDRESS=xxx.xxx.xxx:8080

but I want to change the Sock5 proxy so is there any trick to do this?

Firefox 55.0.2
Imacros Firefox 9.0.3
Windows 10 Home
User avatar
thecoder2012
Posts: 358
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Change sock5 proxy?

Post by thecoder2012 » Wed May 30, 2018 6:09 am

Pucca wrote:Does anyone know a way to change the sock5 proxy? I only found a method to change HTTP proxy

Code: Select all

PROXY ADDRESS=xxx.xxx.xxx:8080

but I want to change the Sock5 proxy so is there any trick to do this?
See using proxy list or plugin on firefox? and Imacros To Extract Firefox Profiles Proxy IP & Port
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
Pucca
Posts: 8
Joined: Fri Jan 15, 2016 10:31 am

Re: Change sock5 proxy?

Post by Pucca » Wed May 30, 2018 12:32 pm

Ok I found some codes and edited to fit my needs but it doesn't seem to work

Code: Select all

var macro = "CODE:";
macro+="SET !DATASOURCE C:\\Users\\Administrator\\Documents\\iMacros\\Downloads\\socks.txt" + "\n";
macro+="SET !DATASOURCE_LINE 1" + "\n;";
macro+="SET !EXTRACT {{!COL1}}";
iimPlayCode(macro);
var ip=iimGetExtract().split(':');
var port = "0"
var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
var a    = pref.getBranch("network.proxy.");
    a.setCharPref("socks", ip[0]);
    a.setIntPref("socks_port", port[1]);

a.setIntPref("type", 1);
I get the error: can not parse macro line: CODE:SET !DATASOURCE C:\Users\Administrator\Documents\iMacros\Downloads\socks.txt (Error code: -910)
I checked that it's the correct path and the file does exist so I don't know why it can't parse that line
chivracq
Posts: 8698
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Change sock5 proxy?

Post by chivracq » Wed May 30, 2018 3:36 pm

Pucca wrote:Ok I found some codes and edited to fit my needs but it doesn't seem to work

Code: Select all

var macro = "CODE:";
macro+="SET !DATASOURCE C:\\Users\\Administrator\\Documents\\iMacros\\Downloads\\socks.txt" + "\n";
macro+="SET !DATASOURCE_LINE 1" + "\n;";
macro+="SET !EXTRACT {{!COL1}}";
iimPlayCode(macro);
var ip=iimGetExtract().split(':');
var port = "0"
var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
var a    = pref.getBranch("network.proxy.");
    a.setCharPref("socks", ip[0]);
    a.setIntPref("socks_port", port[1]);

a.setIntPref("type", 1);
I get the error:

Code: Select all

can not parse macro line: CODE:SET !DATASOURCE C:\Users\Administrator\Documents\iMacros\Downloads\socks.txt (Error code: -910)
I checked that it's the correct path and the file does exist so I don't know why it can't parse that line
Yep, normal... You construct your on-the-fly Macro to be played with 'iimPlay()' but you play it with 'iimPlayCode()'... which doesn't need your String to start with "CODE:", and is apparently not "clever"/tolerant enough to ignore it automatically... :idea:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply