Fixed websocket protocols order based on options
code optimization