Demo GO-SOCKS5

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Test environment

CENTOS7 64

Installation configuration

Install Golang git

Yum Install Golang git

setting Golang Environment variables

Export gopath=/root/gopath/
Export goroot=/usr/lib/golang/

Goroot is the Golang installed directory if the Yum installation uses RPM to find out the installation directory: RPM-QL Golang

Gopath Gopath can create a new directory by itself, the installed GO-SOCKS5 will be placed in the $GOPATH directory

Installing GO-SOCKS5

Go get GITHUB.COM/ARMON/GO-SOCKS5

Go Build

Installation can be completed in the directory to see the CD $GOPATH/pkg

Test

Vim Test_gosocks5.go #go Example of-SOCKS5 readme.md

package mainimport socks5 "github.com/armon/go-socks5"func main() {        conf := &socks5.Config{}        server, err := socks5.New(conf)        if err != nil {          panic(err)        }        // Create SOCKS5 proxy on port 10080        if err := server.ListenAndServe("tcp", "0.0.0.0:10080"); err != nil {          panic(err)        }}

compiling

Go Build Test_gosocks5.go

./TEST_GOSOCKS5 #没有警告就编译成功了

Test

Local test lower Port

NETSTAT-ANPL | grep test_gosocks

Scan the lower port with another host

Nmap myhost-p 10080 # nmap command to install yum install Nmap

If the 10080 port is not open, see if the firewall is turned on

It's all fine. Under window, set the browser socks5 agent try Ha

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.