-
-
Notifications
You must be signed in to change notification settings - Fork 390
Add websocket protocol with http-proxy support #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use "net/url" instead of manual parsing: https://gobyexample.com/url-parsing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment, don't use manual parsing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in last commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And "Blublublu" just under 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename struct to more compliant name, like ligoloHttpServer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a little verbose? Debugf instead of Infof?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 !!