Add websocket protocol with http-proxy support#87
Add websocket protocol with http-proxy support#87nicocha30 merged 5 commits intonicocha30:masterfrom
Conversation
| host, _, err := net.SplitHostPort(*serverAddr) | ||
| if err != nil { | ||
| logrus.Fatal("invalid connect address, please use host:port") | ||
|
|
There was a problem hiding this comment.
Should use "net/url" instead of manual parsing: https://gobyexample.com/url-parsing
There was a problem hiding this comment.
Done in last commit
cmd/agent/main.go
Outdated
| logrus.Fatal("invalid socks5 address, please use host:port") | ||
| } | ||
| conn, err = sockDial(*serverAddr, *socksProxy, *socksUser, *socksPass) | ||
| if strings.Contains(*serverAddr, "https://") || |
There was a problem hiding this comment.
Same comment, don't use manual parsing
There was a problem hiding this comment.
Done in last commit
cmd/agent/main.go
Outdated
| httpClient := &http.Client{Transport: httpTransport} | ||
| httpheader := &http.Header{} | ||
| httpheader.Add("User-Agent", useragent) | ||
| //Add your additional headers here |
There was a problem hiding this comment.
Done in last commit
pkg/controller/controller.go
Outdated
| return Controller{Network: "tcp", Connection: make(chan net.Conn, 1024), ControllerConfig: config, startchan: make(chan error), SelfCertCache: "ligolo-selfcerts"} | ||
| } | ||
|
|
||
| type myHttpServer struct { |
There was a problem hiding this comment.
Rename struct to more compliant name, like ligoloHttpServer
There was a problem hiding this comment.
Done in last commit
pkg/controller/controller.go
Outdated
| //this not so gracefully but effective )) | ||
| for { | ||
| if wsconn != nil { | ||
| logrus.Infof("Got websocket connection %s", wsconn.RemoteAddr()) |
There was a problem hiding this comment.
Maybe a little verbose? Debugf instead of Infof?
There was a problem hiding this comment.
Done in last commit
Update according nicocha30's reviews
|
Hey @virusvfv I pushed some changes in your code. Please test before I can merge. |
Hi again )
According previous talks I re-coded websocket branch again with your last ligolo-ng commits.
This commit adds websocket with http-proxy support.
So U can easier view this PR.
Thanks and regads !!