SOCK5 Agreement (i)

Source: Internet
Author: User

SOCKS Protocol Version 5 Working principle
Http://www.faqs.org/rfcs/rfc1928.html

SOCK5 Agent's work procedure is: (pastes)

1. Request information needs to be sent to the proxy server.
2. Agent Response
3. Send the destination IP and port to the agent when the agent receives the response
4. The agent and the purpose of the connection
5. The agent will require the information sent by the agent to the target party, the information sent by the target party to the required agent. Agent complete.

Because the information transmission on the Internet is carried out using TCP or UDP, so use the SOCKS5 agent can do everything on the internet, and not to the destination will find your IP, both safe and convenient SOCK5 support UDP and TCP, but the two agents are different, the following classification notes

How to use the Proxy TCP protocol

1. Establish a TCP connection to the server's 1080 port.
2. Send to server 05 01 00 (This is 16 code, to the same below)
3. If you receive 05 00, you can be an agent.
4. send 05 01 00 01 + Destination (4 bytes) + Destination port (2 bytes), Destination address and Port are all 16 codes (not strings). )。 For example 202.103.190.27-7201, the message sent is: CA 1 b 1C (ca=202 67=103 be=190 1b=27 1c21=7201)
5. Accept the server return of its own address and port, the connection is complete
6. Subsequent operations and direct TCP connections to the destination are the same.

How to use proxy UDP connections

1. Establish a UDP connection to the server's 1080 port
2. Send to server 05 01 00
3. If you receive 05 00, you can be an agent.
4. send 05 03 00 01 00 00 00 00 + Local UDP port (2 bytes)
5. Server return 05 00 00 01 + Server address + port
6. Require the applicant to send 00 00 00 01 + Destination IP (4 bytes) + Destination Port + the information to send
7.00 00 00 01 + Source Address IP (4 bytes) + Source Port + received information from the required agent when there are reported returns

Note: This is a proxy agreement that does not require a password, but only part of the SOCKS5, complete agreement please RFC1928

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.