Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Expose the Dialer instance #12

Closed
wants to merge 2 commits into from
Closed

Conversation

kubuzetto
Copy link
Contributor

I applied a change that exposes the net.Dialer to be used for the connection via the Opts struct. Instead of using net.DialTimeout, the users of the library can provide a custom Dialer to control more aspects of the connection step than just the timeout.

  • Passing a simple Dialer interface here allows one to mock the actual connection part; making unit tests easier.
  • The users can implement custom dialers to extend the behavior, for example a "proxy dialer" can allow the library to direct the traffic through proxies (this is my use case, and the reason why I'm opening this PR)

@knadh knadh closed this in 620e5d6 Feb 13, 2024
@knadh
Copy link
Owner

knadh commented Feb 13, 2024

Thanks for the PR. Made a minor cosmetic change and merged here 620e5d6

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants