-
Notifications
You must be signed in to change notification settings - Fork 325
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
Add AllocationHandler #324
Comments
Seems like a useful thing to add. Can you be a bit more specific though? What's the API? Where would we call the allocation handler, inside |
This would be in Lines 112 to 122 in f880e55
Good question. What about the following (just a first proposal): // AllocationHandler is a callback to ...
type AllocationHandler func(clientAddr net.Addr) (alternateServer *net.UDPAddr, stun.ErrorCode) |
Do you also want to handle the allocation quota case (as per point 7 above) in the same Why I'm asking this is that every now and then our users complain about the lack of allocation quotas. So far, I failed to find sane API to support this: should we limit allocations per source IP? Or per TURN username/credential? Total allocations? I guess coturn implements the first approach and the third one:
If we follow this course then I think your |
Hi @rg0now, yes this was my plan to also cover quotas with this handler. The whole logic about which quotas are enforced should be user customizable with the handler. We could event provide a few generic handlers for covering the easy cases like you mentioned. It would also be nice to have the TURN credentials as an argument for the handler to cover per-user quotas. I initially also thought about using the handler for implementing custom authentication logic. However we already have the |
We should think about adding support for an
AllocationHandler
in a similar fashion like we already have for thePermissionHandler
.My motiviation behind it is the following:
We could use such a
AllocationHandler
to redirect clients via aALTERNATE-SERVER
response to other TURN servers.However, we should give some flexibility to the user when and which alternate servers are signaled to the client.
This allows the user to define its own schemes to detect an overloaded server, or cycle through different available alternate servers.
The text was updated successfully, but these errors were encountered: