[Reprint] Teach you how to create a SOCKS5 Proxy Server

Source: Internet
Author: User
Source: chinabyte
Network administrators often ask how to effectively manage employees' computer network access permissions, such as blocking the use of QQ, MSN and other chat tools, and prohibiting BT from downloading movies. However, for a general exchange network, it is impossible to implement the method mentioned above through a simple management tool. Just like water flow, it can only be effective if it is intercepted from the source. Blocking measures in the midstream and downstream will only cause flood outbreaks.

Therefore, the network egress is the most effective place to manage the network. We can deploy all network management tasks by configuring a proxy server with dual NICs at the network egress. Today, I will teach you how to build a SOCKS5 proxy server.

  I. Implementation of SOCKS5 Proxy Server on Windows

First, we will introduce the famous NEC SOCKS5 server. readers who have used xnix may be familiar with it. NEC's SOCKS5 software is both open source and free. However, it can only be used in UNIX and Linux without processing. As a Windows user, it is troublesome to select a proxy server on the win platform. professional agent software, such as the isa series, large and complex configuration. For example, CCProxy is a commercial software. It can be used free of charge for no more than three users. The free software has functions that can be implemented without user control and cannot use password authentication.

Is there no way for us to find satisfactory proxy software on windows? Today, I will tell you how to compile NEC SOCKS5 UNIX into Win32. In this way, you can easily create a SOCKS5 Proxy Server on Windows by using the compiled version.

  Ii. Compile NEC's Win32 S5 proxy software for Win32

Step 1: Download The SOCKS5 package from http://www.socks.permeo.com. Of course, we can also search on the Internet. The latest scheme is socks5-v1.0r11.tar.gz.

Step 2: download and install cygwin software from http://www.cygwin.com for later compilation. We can also search online.

Step 3: extract socks5-v1.0r11.tar.gz to the tmp directory of cygwin, that is, cygwin \ TMP \ socks5-v1.0r11, decompression tool to use the most common WinRAR.

Step 4: Modify the cygwin \ USR \ include \ cygwin \ If. h file and add # define iff_pointopoint 0x10 after # define iff_loopback 0x8.

Step 5: Modify socks5-v1.0r11 \ Server \ daemon. c. Find chdir ("/"). Add "//" to block this sentence and make it // chdir ("/").

Note: If you do not add "//" to block this sentence, the system prompts "config: Error opening config file (socks5.conf): no such file or directory" when running SOCKS5 ".

Step 6: Modify socks5-v1.0r11 \ Server \ UDP. C, find

/*

If (authorize (PRI, 0 )! = Auth_ OK ){

S5logupdate (s5logdefaulthandle, s5_log_error, 0, "UDP setup: Setup failed: Permission denied ");

S5err = socks5_authorize;

Rval = exit_auth;

Goto cleanup;

}*/

This code deletes it.

TIPS: We can also not delete this code, but if it is not deleted, the machine running the proxy cannot use the UDP proxy.

Step 7: Run cygwin and switch to the socks5-v1.0r11 directory in cygwin.

Step 8: Enter the following command at a time

./Configure -- With-threads -- With-libconffile = libsocks5.conf -- With-srvconffile = socks5.conf -- With-srvpidfile = socks5.pid -- With-srvpwdfile = login -- With-srvidtfile = socks5.ident

Step 9: Enter make and press Enter.

Step 10: you will find that the socks5-v1.0r11 \ Server \ socks5.exe compiled out, this is what we call the Win32 platform SOCKS5 agent tool main program.

Step 2: Add cygwin \ bin \ cygwin1.dll (library file), socks5.passwd (file for storing usernames and passwords), socks5.conf (configuration file ), it's all about the Win32 S5 proxy server software. During normal operation, you only need to keep the four files in the same directory.

Step 2: At the end, we can test the program producer to enter the directory where socks5.exe is located and run SOCKS5-S-F. If 12th: SOCKS5 starting at Thu Oct 21 16:07:32 01904 in normal mode appears, the software compilation is successful.

  3. Enable proxy

To enable the proxy function on a server, just compile the socks5.exe program. The procedure is as follows:

Step 1: double-click the compiled socks5.exe to run it. A dark Console window appears, minimizing it.

Step 2: the client can use the SOCKS5 Proxy server through the Server IP address and default port 1080.

Step 3: The default port is 1080. Some readers may find it hard to remember or the company has closed the port. You can modify the default proxy port as follows, the method is to add the-B port parameter. For example, to change the proxy port to 8088use “s5.exe-B 8088.

TIPS: If you want to assign a user name and password to the user who uses the proxy to prevent unauthorized users from using the proxy server, you can use the following methods.

Edit socks5.conf and remove the "#" symbol in front of # auth-u. Then edit socks5.passwd. Follow the "user name and password format in one line to enter the user name and password, save and run socks5.exe, the client must add the corresponding user name and password to use the Proxy Server properly.

Summary: although the compilation process is clear, we only need to configure the plug-in, and then use the proxy server to run socks5.exe easily.

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.