Skip to content

luanshaotong/proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kahlys/proxy

godoc build go report

Simple tcp proxy package and executable binary in Golang.

⚠️ This code is for test purpose, it is sometimes ugly, it is not production ready, and the API will probably change. ⚠️

Installation

With a correctly configured Go toolchain:

$ git clone github.com/kahlys/proxy/
$ cd proxy
$ go install cmd/tcpproxy/*.go

Example

The example executable provides both TCP and TCP/TLS connection: cmd/tcpproxy/main.go

By default, the proxy address is localhost:4444 and the target address is localhost:80.

$ tcpproxy
2018/12/13 17:10:25 Proxying from :4444 to :80

You can specify some options.

$ tcpproxy -help
Usage of tcpproxy:
  -lcert string
        certificate file for proxy server side
  -lhost string
        proxy local address (default ":4444")
  -lkey string
        key x509 file for proxy server side
  -ltls
        tls/ssl between client and proxy, you must set 'lcert' and 'lkey'
  -rcert string
        certificate file for proxy client side
  -rhost string
        proxy remote address (default ":80")
  -rkey string
        key x509 file for proxy client side
  -rtls
        tls/ssl between proxy and target, you must set 'rcert' and 'rkey'

About

A simple golang tcp proxy.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 77.0%
  • Shell 20.1%
  • Dockerfile 2.9%