Skip to content
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

Adding username/password parameters to Socks5 config URL #204

Merged
merged 11 commits into from
Mar 26, 2024

Conversation

amircybersec
Copy link
Contributor

This change adds username and password params for authentication to socks5 config URL used to set up the dialer. The URL now accepts UserInfo parameter in form of username:password. For example:

socks5://username:password@domain.com:port

This change was tested with a socks5 proxy server by running connectivity test:

go run . -transport="socks5://foo:bar@pod3.secretexampledomain.com:8080" -proto tcp -resolver 8.8.8.8

{"resolver":"8.8.8.8:53","proto":"tcp","transport":"socks5://REDACTED@pod3.secretexampledomain.com:8080","time":"2024-03-23T03:34:31Z","duration_ms":42,"error":null}

@amircybersec
Copy link
Contributor Author

I had to change go.mod for x packages to point to latest commit on the main branch github.com/Jigsaw-Code/outline-sdk v0.0.0-20240322232535-212ef9692e98 to get the Github build actions pass. I guess we need to update this after bumping up the SDK version. Perhaps we can keep it like this until the SDK version is bumped?

@amircybersec amircybersec requested a review from fortuna March 25, 2024 16:05
Copy link
Contributor

@fortuna fortuna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Let's just update the dependency

x/go.mod Outdated
@@ -3,13 +3,13 @@ module github.com/Jigsaw-Code/outline-sdk/x
go 1.20

require (
github.com/Jigsaw-Code/outline-sdk v0.0.14
github.com/Jigsaw-Code/outline-sdk v0.0.0-20240322232535-212ef9692e98
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the new v0.0.15

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@fortuna fortuna marked this pull request as ready for review March 25, 2024 20:48
@amircybersec amircybersec requested a review from fortuna March 26, 2024 16:59
"github.com/Jigsaw-Code/outline-sdk/transport/socks5"
)

func newSOCKS5StreamDialerFromURL(innerDialer transport.StreamDialer, configURL *url.URL) (transport.StreamDialer, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the Go doc with the new parameter. It doesn't show the credentials currently: https://pkg.go.dev/github.com/Jigsaw-Code/outline-sdk/x/config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fortuna good catch! it slipped my mind. I updated the doc to include authentication params (UserInfo) in the URL.

@fortuna fortuna merged commit d8fffde into Jigsaw-Code:main Mar 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants