WrathChaos / StompClientLib

Simple STOMP Client library, Swift 3 and 4, 4.2, 5 compatible
https://www.freakycoder.com
MIT License
154 stars 81 forks source link

Can't find header in initial call #81

Closed tomasimartin closed 4 years ago

tomasimartin commented 4 years ago

Hi @WrathChaos ,

we found out where the problem came from, when connecting there is an http call where we pass in the header

HEADER={{"host":["dev.myserver.fr"], "sec-websocket-protocol":["], "sec-websocket-key":["M6rALuZT9o3NRROXksQ==="], "sec-websocket-version":["13"], "upgrade":["websocket"], "origin":["http://dev.myserver.fr], "connection":["Upgrade"]}

but I don't find in this header the parameters I added during the connection:

let headerWS = ["deviceId":deviceToken]
socketClient.openSocketWithURLRequest(request: NSURLRequest(url: url as URL), delegate: self, connectionHeaders: headerWS)

it can come from the SocketRocket library, the initial call to the connection is made without taking into account the header.

I'm not good enough in objective-c to modify the lib myself.

Do you have an idea to pass my header ["deviceId":deviceToken], during the initial call

Originally posted by @tomasimartin in https://github.com/WrathChaos/StompClientLib/issues/80#issuecomment-561676449