websocket_ticket function