HTTP API - Socks5 Proxy: Difference between revisions
Jump to navigation
Jump to search
No edit summary Tag: 2017 source edit |
No edit summary |
||
(7 intermediate revisions by the same user not shown) | |||
Line 21: | Line 21: | ||
|} | |} | ||
'''Response Parameters:''' | |||
{| class="wikitable" | {| class="wikitable" | ||
|'''Parameter''' | |'''Parameter''' | ||
Line 29: | Line 29: | ||
|error_code | |error_code | ||
|Integer | |Integer | ||
|Codes that may be returned: 200: MMS has been sent. | |Codes that may be returned: | ||
200: MMS has been sent. | |||
400:Bad request. 500: other errors | 400: Bad request. | ||
500: other errors | |||
503: failed | 503: failed | ||
Line 44: | Line 47: | ||
|} | |} | ||
Example: | '''Example:''' | ||
'''Request:''' | '''Request:''' | ||
curl - | |||
Response: | curl -u admin:admin --anyauth -k -d '{"port":0,"state":"on"}' -H "Content-Type: application/json" <nowiki>https://gateway_ip/api/socks5_proxy</nowiki> | ||
'''Response:''' | |||
{"error_code":200,"sn":"xxxx-xxxx-xxxx-xxxx","socks_port":1080} | {"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:<syntaxhighlight lang="text"> | |||
<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> | |||
</syntaxhighlight> |
Latest revision as of 17:40, 21 June 2024
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>