config: add Dialer option to connect through a proxy#296
config: add Dialer option to connect through a proxy#296HaoweiCh wants to merge 2 commits intonsqio:masterfrom
Conversation
|
I want to vote for accept this PR. We are looking for a way to manage NSQ connection, and a custom dialer solved (partially) our problem. It's a convenient thing. |
mreiferson
left a comment
There was a problem hiding this comment.
Left a few comments, thanks!
| // Dialer affect connection when dialing an nsqd. Overwrite this to connect over proxy. | ||
| // | ||
| // Conflict with options LocalAddr and DialTimeout. | ||
| Dialer Dialer `opt:"dialer"` |
There was a problem hiding this comment.
We need to decide how to handle configuration specified for this opt, e.g. for command line utilities in nsqd that use --consumer-opt.
See: https://github.com/nsqio/nsq/blob/master/apps/nsq_to_file/nsq_to_file.go#L131-L135
And an example of how we handle tls_config: https://github.com/nsqio/go-nsq/blob/master/config.go#L388-L475
| LocalAddr net.Addr `opt:"local_addr"` | ||
| // Dialer affect connection when dialing an nsqd. Overwrite this to connect over proxy. | ||
| // | ||
| // Conflict with options LocalAddr and DialTimeout. |
There was a problem hiding this comment.
Correct, this does conflict. We should probably error when a dialer and either of those two config fields are set.
| // LocalAddr is the local address to use when dialing an nsqd. | ||
| // If empty, a local address is automatically chosen. | ||
| LocalAddr net.Addr `opt:"local_addr"` | ||
| // Dialer affect connection when dialing an nsqd. Overwrite this to connect over proxy. |
There was a problem hiding this comment.
Let's use:
Dialer will be called to connect to an nsqd when set, e.g. through a proxy
Uh oh!
There was an error while loading. Please reload this page.