when I try to connect to a secure websocket, wss://... I get a response header Sec-Websocket-Location: ws://...
any ideas why that might be?
this is immutant running on heroku
immutant 2.1.6
my websocket works fine when I run the server locally, using ws:// but when I deploy and try to access the secure wss://, I get a 1006 code from my JS client
I think the issue might have been unrelated to websockets and immutant all together. I was banging my head against the wall all day yesterday, unable to get my client to successfully connect to the websocket. I thought it was an issue with not being able to properly connect to a secure wss websocket on Heroku. Then I discovered EventSource and decided to give that a try instead; since I’m really just using the channel for server-side events and nothing from the client is being sent to the server. I was getting an error, but this time an exception was being thrown on the server. Turns out, I forgot to set an environment variable on Heroku to connect to my redis instance. Once I did that, EventSource was working as expected. I suspect the connection exception was being swallowed and not showing up in my logs when using the websocket implementation.
@bostonaholic glad to hear you solved it
it was a facepalm moment
🙂
is there not an :on-close callback for Server-Side Events?
@bostonaholic: sse/as-channel is just an extension of async/as-channel, so should support :on-close. Do you have one, and it's just not getting called?
it must not have been, or I might have not properly reloaded
It's possible there is a bug there as well - none of our sse tests have an :on-close
hmmm
I'll throw one on a test and see what happens
I’ve gone back to using a websocket for the time being, since I know that was working
I might take a look at using sse again after a while
thanks!
:on-close isn't getting called for me either
oh no
hmm, if I close the channel from the server side, :on-close does get called. If I close from the client side and try to send!, that should trigger :on-close as well, I think, but doesn't appear to be
I'm going to file an issue for this
great, thanks!
we've got a release almost ready (maybe sometime next week?), I'll take a look at this before then
👍