How to check the connection type (plain/websocket)?

@yuriy0 @semicoleon thanks for your replies.
I have another problem Broadcast server - what is the best way?