-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
I would like to connect to a websocket server (Autobahn), and then subscribe to a channel.
When I use this lib:
websocket = new WebSocket("wss://api.domain.com", "*", "wsservice");
websocket.addEventListener(WebSocketEvent.CLOSED, handleWebSocketClosed);
websocket.addEventListener(WebSocketEvent.OPEN, handleWebSocketOpen);
websocket.addEventListener(WebSocketEvent.MESSAGE, handleWebSocketMessage);
websocket.addEventListener(WebSocketErrorEvent.CONNECTION_FAIL, handleConnectionFail);
websocket.connect();
--- then ---
protected function handleWebSocketOpen(event:WebSocketEvent):void {
websocket.sendUTF(JSON.stringify({
"type": "subscribe",
"channels": ['channel']
}));
}
However when I try to connect, I get the following error:
I DONT KNOW HOW TO HANDLE DER stuff of TYPE 12
Connection Failure: An HTTP response code other than 101 was received. Actual Response Code: 400 HTTP Origin header invalid: No host part in Origin '*'
Metadata
Metadata
Assignees
Labels
No labels