processone / tsung

Tsung is a high-performance benchmark framework for various protocols including HTTP, XMPP, LDAP, etc.
http://www.process-one.net/en/tsung/
GNU General Public License v2.0
2.54k stars 405 forks source link

websocket_subprotocols issues #342

Open gneeri opened 5 years ago

gneeri commented 5 years ago

I actually have two issues, related to the same desired functionality: In our websocket server, we are using Sec-WebSocket-Protocol to pass along a JWT for authorizing the connection. I am able to use the an HTTP request to authenticate and assign a JWT to a local variable, but am unable to send this variable along during the websocket connection that follows a change_type request to websocket. Currently, the only noted way of setting this header is via the websocket_subprotocols. It does not appear that options are permitted to allow for variable substitution; moreover, given the scope of the options node (outside of sessions), this does not even seem possible on a per-connection basis. Ideally, then, I'd love to have some sort of option for setting this header, per connection, inside of the websocket connection request. If there is an alternative for setting this header in that context, I am all ears.

On another (less pressing) front, it appears that the websocket options are not respected when a websocket connection is made following a change_type operation. As indicated above, my current flow is: make an HTTP connection to request a JWT; switch from HTTP to websocket; connect to the websocket server.

In any case, thanks for any thoughts on these matters.