On Sunday, 5 November 2017 13:28:41 UTC-7, Andrey Novoseltsev wrote:
>
> On Saturday, 4 November 2017 17:51:07 UTC-6, Jorge Manrique wrote:
>>
>> Hello Andrey,
>>
>> POST /service worked, thanks.
>>
>> Regarding websockets, I read about the shell/iopub couple here 
>> <https://github.com/sagemath/sagecell/blob/master/doc/messages.md> 
>>
> I replaced the shell/iopub pair with:
>>
>> surl = data.ws_url + "kernel/" + data.id + "/channels";
>> try {
>>   wso = new WebSocket(surl);
>> } catch(e) {
>>   alert(e);
>> }
>>
>> And now the error is:
>>
>> WebSocket connection to 'wss://
>> sagecell.sagemath.org/kernel/74d6b265-9e9d-4eea-b6a6-ef6d1ace3da1/channels' 
>> failed: Error during WebSocket handshake: Unexpected response code: 403
>>
>> I guess the error is because I do not include the header:
>>    Jupyter-Kernel-ID:" + data.id
>> when I create the websocket
>> The issue is that the Javascript Websocket API does not allow to include 
>> a header just like the Python API does
>> I think SockJS API does not allow it either
>>
>
> Is it somehow against socket standards that no custom headers can be 
> added? It is used for load balancing and gives much better results than 
> alternatives (which are cookies that tend to create new and new troubles or 
> IP addresses). It is probably possible to add another matching rule like 
> the one for files 
> https://github.com/sagemath/sagecell/blob/master/contrib/vm/container_manager.py#L264
>  
> to make all URLs with explicit kernel id match it.
>

Hi Jorge,

I've changed the matching rule to pick up kernel ID from URL always, not 
just for files. Can you check if your code behaves any better now?

Thank you!
Andrey

 
>
>>
>> Any suggestions?
>> Jorge
>>
>> El sábado, 4 de noviembre de 2017, 1:15:10 (UTC-4), Andrey Novoseltsev 
>> escribió:
>>>
>>> Hi Jorge,
>>>
>>> Thanks a lot for trying and reporting results!
>>>
>>> For POST / service: can you try print(factorial(10)) with explicit 
>>> output? I suspect the display hook works differently for it, that's why the 
>>> health check uses code = 'print({} + {})'.format(a, b)
>>>
>>> For Websockets: where did you learn shell/iopub additions? They were 
>>> indeed used a couple years ago, but now there is a single link with channel 
>>> name embedded in messages, 
>>> https://github.com/sagemath/sagecell/blob/master/contrib/sagecell-client/sagecell-client.py#L31
>>>  
>>> is relevant.
>>>
>>> Best,
>>> Andrey
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-cell/91f3e7d1-755c-4ab1-b9a8-a3ead70b678a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to