The example code only shows basic authentication through a proxy while sending requests with PHP. If you want to continue further development, we highly recommend reading their documentation.
Install and set up the PHP programming language on your machine. If you don't want to use the default built-in HTTP server, you'll also need to install one, such as Apache.
You should also have a Smartproxy account with access to the dashboard to get your credentials and endpoint information.
- Create a project directory.
- Open the directory using the Terminal/Command prompt using the
cd directory_name
command. - Execute the following command to download the proxy setup example file:
HTTP(s):
curl https://raw.githubusercontent.com/Smartproxy/Smartproxy/master/php/php.php > php.php
SOCKS5:
curl https://raw.githubusercontent.com/Smartproxy/Smartproxy/master/php/php.php > phpsocks5h.php
-
You should see a new file named php.php in your project folder. Open it using an 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 run this example code, you'll need to set up your HTTP server.
Once you have it set up, you can access the file with the path it has been stored in your server. For example, http://localhost/php.php
You should see an IP address in the console window if everything was set up correctly:
Email - sales@smartproxy.com