HTTP API - Socks5 Proxy
POST http://gateway_ip/api/socks5_proxy
Request Parameters:
Parameter | Type | Description |
Required Parameter | ||
port | Interger | |
state | String | It could be “on” or “off”.
Use “on” to enable socks5 proxy on this port. Use “off” to disable socks5 proxy on this port. |
Response Parameters:
Parameter | Type | Description |
error_code | Integer | Codes that may be returned:
200: MMS has been sent. 400: Bad request. 500: other errors 503: failed |
sn | String | SN of the gateway |
socks_port | Interger | socks proxy port for this request. |
Example:
Request:
curl -u admin:admin --anyauth -k -d '{"port":0,"state":"on"}' -H "Content-Type: application/json" https://gateway_ip/api/socks5_proxy
Response:
{"error_code":200,"sn":"xxxx-xxxx-xxxx-xxxx","socks_port":1080}
Where sock5 proxy port is 1080.
Then sock5 proxy can be tested with the following command:
curl --socks5 gateway_ip:1080 google.com or
curl --socks5-hostname gateway_ip:1080 google.com
will return:
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>