StefanKopieczek/gossip

Replies are being sent back from a random source port

Opened this issue · 2 comments

Hello,
First of all, thanks for the excellent work..
Seems like when running a UDP 'server' all replies are being sent from a random source port.
This will mostly work but in many cases (especially NATed clinets) it might cause some problems. Firewalls will usually drop such message if the source/dest port/ip cannot be matched.
Ideally, the server should send responses to the same ip:port that the request was received from.

Hey Csiwek, sorry we didn't get back to you sooner.

You're spot on about the random UDP port, and I agree completely with your analysis about the impact on NATed clients. We should definitely fix that up – I'll take a look. Cheers again for flagging this, and glad you're finding Gossip useful :)

Thanks for the answer.
Sorry for not sending it as a pull request but this is just my temporary solution which I know is not correct but does the job for now. (only works for UDP connections and also includes a small fix for not adding display names in From/To headers if empty).

https://gist.github.com/csiwek/e7421d4d37a23029db7d927fb7def9c9