HTTP API - Socks5 Proxy: Difference between revisions

From Ultiroam User Docs
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 51: Line 51:
'''Request:'''
'''Request:'''


curl -k --anyauth -u admin:admin -d '{"port":0,"state":"on"}' -H  "Content-Type: application/json" <nowiki>https://gateway_ip/api/socks5_proxy</nowiki>
curl -u admin:admin --anyauth --d '{"port":0,"state":"on"}' -H  "Content-Type: application/json" <nowiki>https://gateway_ip/api/socks5_proxy</nowiki>


'''Response:'''
'''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>