-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Frequently asked questions
Marcel Prestel edited this page Feb 1, 2018
·
7 revisions
- I'm getting the exception
WebsocketNotConnectedException
. What should I do? - How can I add additional headers to my WebSocketClient connection?
- How can I add additional headers to my WebSocketServer response?
This exception indicates that the connection is not yet established. Due to that reason you are not allowed to send any message to the other endpoint. You can do one of two things to avoid this exception:
- Check, if the connection is open and ready to send messages with
isOpen()
- Use the blocking method
connectBlocking()
, which is blocking till a connection is established (or an error occurred)
You can add additional headers (like Origin
or Cookie
) to your handshake, please check out this example here.
You can add additional headers (like Access-Control-Allow-Origin
) to your handshake, please check out this example here.