-
Notifications
You must be signed in to change notification settings - Fork 52
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
Optionally restrict the range of ephemeral ports #63
base: main
Are you sure you want to change the base?
Conversation
a9d94e4
to
36ca8e8
Compare
Hi! Thanks for putting this together. It feels as though this is only fixing part of the problem, there are many calls to Also we're going to need an explicit test for this, as well as a test for resource exhaustion (no more ports available in the specific range). |
I'll try to put some tests together. |
Codecov ReportBase: 99.75% // Head: 99.91% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
==========================================
+ Coverage 99.75% 99.91% +0.16%
==========================================
Files 8 8
Lines 1205 1196 -9
==========================================
- Hits 1202 1195 -7
+ Misses 3 1 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
You're right, we can forget about mDNS.
I'm not sure what you mean here, we are not setting the local port: Lines 416 to 425 in 2aed57f
Concerning the actual API, instead of |
b0f060f
to
fd2d09a
Compare
turn.py creates a socket that is associated with a known remote address/port, and for this reason I'm not sure if it's important to be able to restrict which local port to use here, but I'll admit that I'm not 100% sure. I moved the critical code to utils.py however, so if it is indeed desirable to be able to restrict the local port for STUN as well it should take me about 5 minutes to do that. Do you have any input on this, gregvish ?
Good idea, that would allow a set of ports that is not restricted to a continuous sequence. |
439c5e8
to
756e438
Compare
cc32ffc
to
13a23e4
Compare
I have a use for this with broadcasting data over a restricted port range. Any chance this could get merged? |
Merge would be very appreciated |
Optionally restrict the range of ephemeral ports that the Connection class can bind to.
This is a proposed fix for #47