HTTP API - Socks5 Proxy: Difference between revisions
		
		
		
		Jump to navigation
		Jump to search
		
|  (Created page with "=== 9.1         Request === '''POST <nowiki>https://gateway_ip/api/socks5_proxy</nowiki>'''    9.2         '''Request Parameter'''   {| class="wikitable" |'''Parameter''' |'''Type''' |'''Description''' |- | colspan="3" |'''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. |}    == 9.3         Response Paramet...") | No edit summary | ||
| (8 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| '''POST <nowiki>http://gateway_ip/api/socks5_proxy</nowiki>'''    | |||
| '''POST <nowiki> | |||
| '''Request Parameters:'''   | |||
| {| class="wikitable" | {| class="wikitable" | ||
| Line 22: | Line 21: | ||
| |}    | |}    | ||
| '''Response Parameters:''' | |||
| {| class="wikitable" | {| class="wikitable" | ||
| |'''Parameter''' | |'''Parameter''' | ||
| Line 30: | 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 45: | Line 47: | ||
| |}   | |}   | ||
| '''Example:''' | |||
| '''Request:''' | |||
| 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>