If you want to continue development with Node.js, we highly recommend reading their documentation.
To run the following code example, you'll need Node.js and the Axios HTTP client:
You should also have a Decodo account with access to the dashboard to get your credentials and endpoint information.
Once you have the prerequisites installed, follow these steps to set up your project:
- Using the Command Prompt/Terminal, create your project directory using the
mkdir node_examplecommand. - Navigate to your project folder using the
cd node_examplecommand. - Copy the code directly from the above or execute the following command to download the proxy setup example file:
HTTP(s):
curl https://raw.githubusercontent.com/Decodo/Decodo/master/nodejs/node.js > node.js
SOCKS5:
curl https://raw.githubusercontent.com/Decodo/Decodo/master/nodejs/node.js > nodesocks5h.js
-
You should see a new file named
node.jsin your project folder. Open it using a code editor of your choice. -
To run this example, set your username, password, and endpoint information you'd like to use and enter them in the following sections of the code:
proxy: {
host: 'gate.decodo.com'
port: 7000,
auth: {
username: 'user',
password: 'password'
}
}
To execute the Node.js example, simply run node node.js.
You should see an IP address in the console window if everything was set up correctly:
Email - [email protected]
