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 Smartproxy 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_example
command. - Navigate to your project folder using the
cd node_example
command. - 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/Smartproxy/Smartproxy/master/nodejs/node.js > node.js
SOCKS5:
curl https://raw.githubusercontent.com/Smartproxy/Smartproxy/master/nodejs/node.js > nodesocks5h.js
-
You should see a new file named
node.js
in 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:
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 - sales@smartproxy.com