-
Notifications
You must be signed in to change notification settings - Fork 92
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
Outbound proxy #5
Comments
Hello @negbie , |
Currently you use msg.Destination() as the socket address here: This makes it hard to use an outbound address which is different than the domain address. Maybe func NewLayer( can be changed to take a new proxy argument? |
With that the send method can be extended with some logic to check if proxy != "" and so on... |
You are right, with current implementation it's hard to override. type LayerConfig {
HostIP net.IP
ProxyAddr net.Addr
...
} |
Yeah that would be a way. Another way would be to use functional options https://sagikazarmark.hu/blog/functional-options-on-steroids/ Add ProxyAddr net.Addr to the layer struct and add a Proxy function which will return func(*layer). Now you can change the layer constructor to something like func NewLayer( This has the benefit that it wouldn't be a breaking change. |
Functional options looks very promising, especially non breaking api. |
@ghettovoice will do it asap. |
Hello @negbie, I'm checking in to see if you had a chance to work on this feature. In case you were not able to, could you please share any progress you made on this? I will be happy to take this forward. |
+1, interested in this |
Hi @ghettovoice would you be interested in a outbound proxy setting? Maybe by changing the NewLayer function signature? But this would be a breaking change. If you are interested I can create a pr but first I want to discuss it with you.
The text was updated successfully, but these errors were encountered: