Documentation ¶
Overview ¶
Package wskey is a context key used by negotiators.
We are doing exactly what the context package tells us not to do and using it to pass optional arguments to the function (in this case, whether to use the WebSocket subprotocol or not). A better way to do this would be to move the negotiator to an internal/negotiator package and have xmpp and websocket both import and use that. Unfortunately, that would cause import loops (because the negotiator function takes an xmpp.Session, so the internal/negotiator package would also need to import the xmpp package). We could also copy/pate the entire implementation into websocket, but this is a maintainability nightmare.
Having a secret internal API may not be ideal, but it does let us get away with a nice surface API without any real drawbacks other than an extra tiny internal package to house this key.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.