Using your Proxy Account with Node.js

From FoxyProxy Documentation
Revision as of 03:54, 2 December 2015 by Ejung (Talk | contribs)

Jump to: navigation, search

This Node.js example connects to through a proxy server with your proxy username and password. Be sure to replace username, password, and port (3128) in this example with your account information. In this example, the Node.js client connects to the proxy server using HTTP and instructs the proxy server to connect to the final destination ( using HTTPS.

var request = require('request');
        'proxy':''}, function (error, response, body) {
    if (!error && response.statusCode == 200) {
    else console.log("error");

More info about the request module in Node.js, including how to install it.