Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Felipe Gasper


> On Sep 15, 2020, at 11:20 AM, Sebastian Riedel  wrote:
> 
> An HTTP-level error response--maybe 426--would probably be most sensible. 
> 
> What error would common browsers give in that case? 

They’d give whatever error as with any other HTTP-level failure during a WS 
handshake.

Chrome shows a console error with the response code. A 404, for example, yields:


Error during WebSocket handshake: Unexpected response code: 404


-FG

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/6AB67496-744B-4CC5-9899-DFE0DEDF6965%40felipegasper.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Sebastian Riedel

>
> An HTTP-level error response--maybe 426--would probably be most sensible. 
>

What error would common browsers give in that case? 

--
Sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/648435bf-62f7-45f6-a5fc-958d13411c42n%40googlegroups.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Felipe Gasper


> On Sep 15, 2020, at 9:30 AM, Sebastian Riedel  wrote:
> 
> Given this, should Mojo even send a response? Or if it does, should it at 
> least warn “failed to negotiate subprotocol; sending handshake response 
> anyway”?
> 
>  So you want Mojolicious to cause a TCP level connection error instead of 
> letting the handshake fail properly? That seems like a really bad idea.

An HTTP-level error response--maybe 426--would probably be most sensible.

-FG

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/BA5FBD04-A338-481B-9D9A-CE5834EE732F%40felipegasper.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Sebastian Riedel

>
> Given this, should Mojo even send a response? Or if it does, should it at 
> least warn “failed to negotiate subprotocol; sending handshake response 
> anyway”?
>

 So you want Mojolicious to cause a TCP level connection error instead of 
letting the handshake fail properly? That seems like a really bad idea.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/82d92a26-0dc5-4493-be0b-9d89c67ae14fn%40googlegroups.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Felipe Gasper
RFC 6455/1.9 states:

The client can request that the server use a specific subprotocol by
   including the |Sec-WebSocket-Protocol| field in its handshake.  If it
   is specified, the server needs to include the same field and one of
   the selected subprotocol values in its response for the connection to
   be established.

Given this, should Mojo even send a response? Or if it does, should it at least 
warn “failed to negotiate subprotocol; sending handshake response anyway”?

-FG

> On Sep 15, 2020, at 04:21, Mikhail  wrote:
> 
> 
> Chrome browser  absolutely described the error in that it sent a subprotocol 
> header ('null' for that case). So solve
> 
> $ws->tx->with_protocols('binary', 'null');
> 
> Let binary subprotocol is present also.
> понедельник, 14 сентября 2020 г. в 17:29:31 UTC+5, fel...@felipegasper.com: 
>> That seems an odd error from Chrome, if that’s the fix .. was the browser 
>> sending a subprotocol in the handshake?
>> 
>> -F
>> 
 On Sep 14, 2020, at 07:37, Mikhail  wrote:
 
>>> Thanks! Forever ♥ Mojolicious!
>> 
>>> 
>>> 
>>> понедельник, 14 сентября 2020 г. в 13:41:46 UTC+5, Sebastian Riedel: 
 Then you need to negotiate a subprotocol.
 
 --
 sebastian
>>> 
>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Mojolicious" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to mojolicious...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/mojolicious/68624663-2baf-4bc2-a24e-b8fc135ff15dn%40googlegroups.com.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mojolicious/e4166da1-91ce-40e3-810b-2511725ad8b1n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/A14CC5C0-FA85-45B6-9334-DDF35FAD175B%40felipegasper.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Mikhail
Chrome browser  absolutely described the error in that it sent a 
subprotocol header ('null' for that case). So solve

$ws->tx->with_protocols('binary', 'null');

Let binary subprotocol is present also.
понедельник, 14 сентября 2020 г. в 17:29:31 UTC+5, fel...@felipegasper.com: 

> That seems an odd error from Chrome, if that’s the fix .. was the browser 
> sending a subprotocol in the handshake?
>
> -F
>
> On Sep 14, 2020, at 07:37, Mikhail  wrote:
>
> Thanks! Forever ♥ Mojolicious!
>
>
>
> понедельник, 14 сентября 2020 г. в 13:41:46 UTC+5, Sebastian Riedel: 
>
>> Then you need to negotiate a subprotocol.
>>
>> --
>> sebastian
>>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojolicious...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mojolicious/68624663-2baf-4bc2-a24e-b8fc135ff15dn%40googlegroups.com
>  
> 
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/e4166da1-91ce-40e3-810b-2511725ad8b1n%40googlegroups.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-14 Thread Felipe Gasper
That seems an odd error from Chrome, if that’s the fix .. was the browser 
sending a subprotocol in the handshake?

-F

> On Sep 14, 2020, at 07:37, Mikhail  wrote:
> 
> Thanks! Forever ♥ Mojolicious!
> 
> понедельник, 14 сентября 2020 г. в 13:41:46 UTC+5, Sebastian Riedel: 
>> Then you need to negotiate a subprotocol.
>> 
>> --
>> sebastian
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mojolicious/68624663-2baf-4bc2-a24e-b8fc135ff15dn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/33AC68A2-F3E8-4C8B-BB60-05D6EABA46A1%40felipegasper.com.


[Mojolicious] Re: web cam websocket

2020-09-14 Thread Mikhail
Thanks! Forever ♥ Mojolicious!

понедельник, 14 сентября 2020 г. в 13:41:46 UTC+5, Sebastian Riedel: 

> Then you need to negotiate a subprotocol.
>
> --
> sebastian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/68624663-2baf-4bc2-a24e-b8fc135ff15dn%40googlegroups.com.


[Mojolicious] Re: web cam websocket

2020-09-14 Thread Sebastian Riedel
Then you need to negotiate a subprotocol.

--
sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/24ee8e0a-9470-425a-93e0-c2827a8d6152n%40googlegroups.com.