Fork me on GitHub
#immutant
<
2017-05-11
>
bostonaholic01:05:57

when I try to connect to a secure websocket, wss://... I get a response header Sec-Websocket-Location: ws://...

bostonaholic01:05:04

any ideas why that might be?

bostonaholic01:05:20

this is immutant running on heroku

bostonaholic01:05:53

immutant 2.1.6

bostonaholic01:05:44

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

bostonaholic14:05:01

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.

jcrossley316:05:18

@bostonaholic glad to hear you solved it

bostonaholic16:05:43

it was a facepalm moment

bostonaholic17:05:05

is there not an :on-close callback for Server-Side Events?

tcrawley22:05:18

@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?

bostonaholic22:05:03

it must not have been, or I might have not properly reloaded

tcrawley22:05:34

It's possible there is a bug there as well - none of our sse tests have an :on-close

tcrawley22:05:15

I'll throw one on a test and see what happens

bostonaholic22:05:16

I’ve gone back to using a websocket for the time being, since I know that was working

bostonaholic22:05:30

I might take a look at using sse again after a while

tcrawley22:05:47

:on-close isn't getting called for me either

tcrawley23:05:13

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

tcrawley23:05:58

I'm going to file an issue for this

bostonaholic23:05:20

great, thanks!

tcrawley23:05:59

we've got a release almost ready (maybe sometime next week?), I'll take a look at this before then