crossbario / autobahn-js

WAMP in JavaScript for Browsers and NodeJS
http://crossbar.io/autobahn
MIT License
1.43k stars 228 forks source link

Allow access to the underlying socket when using WebSocket transport #325

Open MrSpider opened 6 years ago

MrSpider commented 6 years ago

Native websockets allow checking the amount of bytes in the send buffer via socket.bufferedAmount We are using this to do rate limiting for slow connections.

There is currently no way to access the raw socket from the WebSocket transport. Maybe one could save the socket into transport._socket ?

If this would be an acceptable solution then I'll make a pull request.

oberstet commented 6 years ago

Instead of exposing the socker directly to user API, a better fit would be to add another transport option (for transports of type websocket): https://github.com/crossbario/autobahn-js/blob/master/doc/reference.md#connection-options