Skip to content

PualrDwade/doo-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

doo-proxy

doo-proxy is a simple http/https proxy implement by golang

quick start

go get github.com/PualrDwade/doo-proxy

go install github.com/PualrDwade/doo-proxy

./doo-proxy -credential "aksldjhlkasdj" (your credential)

key funciton

all thing to understand is a code snippet bellow:

func (proxy *dooProxy) tunnel(clientConn net.Conn, remoteConn net.Conn) {
	group := &sync.WaitGroup{}
	group.Add(2)
	go func() {
		defer group.Done()
		_, err := io.Copy(remoteConn, clientConn)
		if err != nil {
			log.Error(err.Error())
		}
	}()
	go func() {
		defer group.Done()
		_, err := io.Copy(clientConn, remoteConn)
		if err != nil {
			log.Error(err.Error())
		}
	}()
	group.Wait()
}

About

simple http/https proxy implement by golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published