Re: [E-devel] [RFC] Efl.Net.Dialer.Websocket

2016-09-01 Thread Gustavo Sverzut Barbieri
Hi all,

Since nobody called for changes in the API, it was merged in GIT after
extensive testing using the awesome http://autobahn.ws/testsuite
pointed by Raoul.

Note that to test you need CURL from GIT (7.50.2-DEV) as they
committed a fix to their handling of unknown 101 (Switch Protocols).
While in real-life this is hardly hitting the user, during autobahn
test many cases start with a very small frame (2-4 bytes) and CURL
wouldn't process then unless they were 5 bytes long. After the first
frame is longer than 5 bytes everything works with the old CURL (ie:
you can talk to ws://echo.websocket.org)

It was also very nice way to test the Efl_Net_Dialer_Http with more
data patterns, some fixes got in.






On Tue, Aug 30, 2016 at 1:04 AM, Gustavo Sverzut Barbieri
 wrote:
> Hi all,
>
> I'm taking over the work started at
> https://phab.enlightenment.org/D2985, please take a look at my last
> comment https://phab.enlightenment.org/D2985#71145 for more details.
>
> The branch is 
> https://git.enlightenment.org/core/efl.git/log/?h=devs/barbieri/websocket
> there you can see two examples of the API usage.
>
> If you're not familiar with WebSocket, it's a bi-directional
> message-based (NOT streaming!) protocol on top of HTTP, starts with a
> GET request and requests a connection upgrade, then can use proxies,
> TLS/SSL and authentication. It's used to avoid polling web-servers
> with new HTTP requests for data, such as Stock Tickers, WebEditors and
> so on. Compared to an older solution SSE (Server-Side Events), it
> offers more efficient message framing and bi-directional
> communication.
>
> My branch builds on top of Efl.Net.Dialer.Http (our new HTTP client
> based on CURL) and exposes a new API for the message-based primitives
> of WebSockets. However, to play nice with other Efl.Io.Reader and
> Efl.Io.Writer users, such as Efl.Io.Copier, you can ask
> Efl.Net.Dialer.Websocket to operate in streaming mode, picking one of
> Text or Binary messages as your channel. Then the traditional
> "can_read"/"read()", "can_write"/"write()" will work.
>
> Play with them and let me know what you think. In the phab comment you
> can see how to create a nodejs websocket server to make your testing
> simpler.
>
> What do you think about this API?
>
> --
> Gustavo Sverzut Barbieri
> --
> Mobile: +55 (16) 99354-9890



-- 
Gustavo Sverzut Barbieri
--
Mobile: +55 (16) 99354-9890

--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [RFC] Efl.Net.Dialer.Websocket

2016-08-31 Thread Raoul Hecky
>
> I see... well, the WebSocket's primitives aren't that many, I suppose
> you're code is mostly focused on text of binary messages, so it's one
> method and one event.  Some #ifdef would do?
>
> Naa it's not that easy ;)


> I know the feeling of "not willing to touch something that it's
> working", but if you want to help... :-)
>
>
>
> >> Also: do you use some plublic web service? Which one? I may add another
> >> example and using something more real than a echo server would be nice.
> >>
> > Except for the echo public server, not really.
>
> hum... ok, so you use calaos as both server and client in this scope?
> Is this expected to go over the internet or just local networking...
> IOW: why did you pick WebSocket?
>
We use websocket because we have multiple type of client connecting to the
server:
- web app using angularjs and websocket
- mobile app, qt with websocket
- desktop UI
websocket also allows us to easily pass all kind of proxy/firewall as well
as putting a ssl layer on top of it.


>
> --
> Gustavo Sverzut Barbieri
> --
> Mobile: +55 (16) 99354-9890
>
> 
> --
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [RFC] Efl.Net.Dialer.Websocket

2016-08-30 Thread Gustavo Sverzut Barbieri
On Tue, Aug 30, 2016 at 10:00 AM, Raoul Hecky  wrote:
>>
>> Nice! Would you also try to do some tests or rewrite some part of your
>> existing code to use my proposed API?
>>
> Not really. The code is written in C++ in calaos and all is working
> smoothly, so rewriting
> is not something we want to do right now... And your implementation is only
> for
> client, not server.

I see... well, the WebSocket's primitives aren't that many, I suppose
you're code is mostly focused on text of binary messages, so it's one
method and one event.  Some #ifdef would do?

I know the feeling of "not willing to touch something that it's
working", but if you want to help... :-)



>> Also: do you use some plublic web service? Which one? I may add another
>> example and using something more real than a echo server would be nice.
>>
> Except for the echo public server, not really.

hum... ok, so you use calaos as both server and client in this scope?
Is this expected to go over the internet or just local networking...
IOW: why did you pick WebSocket?


-- 
Gustavo Sverzut Barbieri
--
Mobile: +55 (16) 99354-9890

--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [RFC] Efl.Net.Dialer.Websocket

2016-08-30 Thread Raoul Hecky
>
> Nice! Would you also try to do some tests or rewrite some part of your
> existing code to use my proposed API?
>
Not really. The code is written in C++ in calaos and all is working
smoothly, so rewriting
is not something we want to do right now... And your implementation is only
for
client, not server.


>
> Also: do you use some plublic web service? Which one? I may add another
> example and using something more real than a echo server would be nice.
>
Except for the echo public server, not really.


> One thing that I heavily used to validate my implementation was to use the
> > Autobahn Websocket Testsuite project. It runs hundreds of test on your
> > client or server implementation and gives you nice results and message on
> > what is not working as expected.
> >
> > Link:
> > http://autobahn.ws/testsuite/
>
>
> Nice to know its a good test suite. It was mentioned in the nodejs
> framework I used to test, but I was doing only manual tests using that. Now
> that it works, must do some extensive testing.
>
>
> --
> Gustavo Sverzut Barbieri
> --
> Mobile: +55 (16) 99354-9890
> 
> --
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [RFC] Efl.Net.Dialer.Websocket

2016-08-30 Thread Gustavo Sverzut Barbieri
Hi Raoul!

Em terça-feira, 30 de agosto de 2016, Raoul Hecky 
escreveu:

> Hi Gustavo,
>
> As I implemented websocket (server+client) in calaos on top of ecore_con, I
> know some things about websocket ;)


Nice! Would you also try to do some tests or rewrite some part of your
existing code to use my proposed API?

Also: do you use some plublic web service? Which one? I may add another
example and using something more real than a echo server would be nice.


One thing that I heavily used to validate my implementation was to use the
> Autobahn Websocket Testsuite project. It runs hundreds of test on your
> client or server implementation and gives you nice results and message on
> what is not working as expected.
>
> Link:
> http://autobahn.ws/testsuite/


Nice to know its a good test suite. It was mentioned in the nodejs
framework I used to test, but I was doing only manual tests using that. Now
that it works, must do some extensive testing.


-- 
Gustavo Sverzut Barbieri
--
Mobile: +55 (16) 99354-9890
--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [RFC] Efl.Net.Dialer.Websocket

2016-08-30 Thread Raoul Hecky
Hi Gustavo,

As I implemented websocket (server+client) in calaos on top of ecore_con, I
know some things about websocket ;)

One thing that I heavily used to validate my implementation was to use the
Autobahn Websocket Testsuite project. It runs hundreds of test on your
client or server implementation and gives you nice results and message on
what is not working as expected.

Link:
http://autobahn.ws/testsuite/

Cheers!


--
Raoul Hecky

2016-08-30 6:04 GMT+02:00 Gustavo Sverzut Barbieri :

> Hi all,
>
> I'm taking over the work started at
> https://phab.enlightenment.org/D2985, please take a look at my last
> comment https://phab.enlightenment.org/D2985#71145 for more details.
>
> The branch is https://git.enlightenment.org/core/efl.git/log/?h=devs/
> barbieri/websocket
> there you can see two examples of the API usage.
>
> If you're not familiar with WebSocket, it's a bi-directional
> message-based (NOT streaming!) protocol on top of HTTP, starts with a
> GET request and requests a connection upgrade, then can use proxies,
> TLS/SSL and authentication. It's used to avoid polling web-servers
> with new HTTP requests for data, such as Stock Tickers, WebEditors and
> so on. Compared to an older solution SSE (Server-Side Events), it
> offers more efficient message framing and bi-directional
> communication.
>
> My branch builds on top of Efl.Net.Dialer.Http (our new HTTP client
> based on CURL) and exposes a new API for the message-based primitives
> of WebSockets. However, to play nice with other Efl.Io.Reader and
> Efl.Io.Writer users, such as Efl.Io.Copier, you can ask
> Efl.Net.Dialer.Websocket to operate in streaming mode, picking one of
> Text or Binary messages as your channel. Then the traditional
> "can_read"/"read()", "can_write"/"write()" will work.
>
> Play with them and let me know what you think. In the phab comment you
> can see how to create a nodejs websocket server to make your testing
> simpler.
>
> What do you think about this API?
>
> --
> Gustavo Sverzut Barbieri
> --
> Mobile: +55 (16) 99354-9890
>
> 
> --
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] [RFC] Efl.Net.Dialer.Websocket

2016-08-29 Thread Gustavo Sverzut Barbieri
Hi all,

I'm taking over the work started at
https://phab.enlightenment.org/D2985, please take a look at my last
comment https://phab.enlightenment.org/D2985#71145 for more details.

The branch is 
https://git.enlightenment.org/core/efl.git/log/?h=devs/barbieri/websocket
there you can see two examples of the API usage.

If you're not familiar with WebSocket, it's a bi-directional
message-based (NOT streaming!) protocol on top of HTTP, starts with a
GET request and requests a connection upgrade, then can use proxies,
TLS/SSL and authentication. It's used to avoid polling web-servers
with new HTTP requests for data, such as Stock Tickers, WebEditors and
so on. Compared to an older solution SSE (Server-Side Events), it
offers more efficient message framing and bi-directional
communication.

My branch builds on top of Efl.Net.Dialer.Http (our new HTTP client
based on CURL) and exposes a new API for the message-based primitives
of WebSockets. However, to play nice with other Efl.Io.Reader and
Efl.Io.Writer users, such as Efl.Io.Copier, you can ask
Efl.Net.Dialer.Websocket to operate in streaming mode, picking one of
Text or Binary messages as your channel. Then the traditional
"can_read"/"read()", "can_write"/"write()" will work.

Play with them and let me know what you think. In the phab comment you
can see how to create a nodejs websocket server to make your testing
simpler.

What do you think about this API?

-- 
Gustavo Sverzut Barbieri
--
Mobile: +55 (16) 99354-9890

--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel