Re: POE HTTP server with WebSocket channel
Konstantin Yakunin <[email protected]> Thu, 12 Dec 2013 11:33:01 +0400
| Newsgroups | gmane.comp.lang.perl.poe |
|---|---|
| Message-ID | <CAM1hPL0wTNDvxk-G=kGoRAyFE=zufvqkaOoEZ71MEvQnAmk8TA@mail.gmail.com> |
--001a1136033e02879004ed515b97
Content-Type: text/plain; charset=ISO-8859-1
Hello,
Try Plack::Builder
use Plack::Builder;
builder {
}
2013/12/11 Guido Brugnara <[email protected]>
> Hello,
> this is the first time I write in this mail-list, and I hope that the
> question is pertinent. You smile as well for my poor english.
>
> I need to change an application that currently uses Protocol::WebSocket
> and POE::Component::Server::TCP packages so that it can accept from the
> same port even normal HTTP calls.
>
> I currently use POE::Component::Server::HTTP but on a different port (
> http://myapp:8000 and ws://myapp:8001).
>
> The target is to listen on the same port: http://myapp:8000/..... and
> for websocket ws://myapp:8000/ws
>
> I tried to use Protocol::WebSocket with the TCP socket used by
> PoCo::Server::HTTP but my work is stalled.
>
> I saw on CPAN that would be available the following packages :
>
> POEx::Role::PSGIServer - Encapsulates core PSGI server behaviors
>
> Plack::App::WebSocket - WebSocket server as a PSGI application
> or
> method "new_from_psgi" of Protocol::WebSocket::Handshake::Server
>
> Unfortunately I can not find enough documentation to overcome the initial
> impact and achieve at least a first prototype.
>
> If you know of resources such as books, sample code , slides, suggestions
> to help me, please feel free to report them , thank you.
>
> As a"extrema ratio" I can use an external reverse proxy (http and
> websocket ) to aggregate the two services but would like to avoid
> maintaining a single process to manage the application, as it is now .
>
>
> best regards
> gdo
>
> P.S. I use POE for a few years and I will continue to do so for many ...
>
>
--001a1136033e02879004ed515b97
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"> <div class=3D"gmail_extra">Hello,<br><br></div><div class=
=3D"gmail_extra">Try Plack::Builder<br><br></div><div class=3D"gmail_extra"=
>use Plack::Builder;<br><br></div><div class=3D"gmail_extra">builder {<br><=
br>}<br>
</div><div class=3D"gmail_extra"><br><br></div><div class=3D"gmail_extra"><=
br></div><div class=3D"gmail_extra"><div class=3D"gmail_quote">2013/12/11 G=
uido Brugnara <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>></span><br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Hello,<br>
this is the first time I write in this mail-list, and I hope that the quest=
ion is pertinent. You smile as well for my poor english.<br>
<br>
I need to change an application that currently uses Protocol::WebSocket and=
POE::Component::Server::TCP packages so that it can accept from the same p=
ort even normal HTTP calls.<br>
<br>
I currently use POE::Component::Server::HTTP but on a different port (<a hr=
ef=3D"http://myapp:8000" target=3D"_blank">http://myapp:8000</a> and ws://m=
yapp:8001).<br>
<br>
The target is to listen on the same port: <a href=3D"http://myapp:8000/..."=
target=3D"_blank">http://myapp:8000/...</a>.. =A0and for websocket ws://my=
app:8000/ws<br>
<br>
I tried to use Protocol::WebSocket with the TCP socket used by PoCo::Server=
::HTTP but my work is stalled.<br>
<br>
I saw on CPAN that would be available the following packages :<br>
<br>
POEx::Role::PSGIServer - Encapsulates core PSGI server behaviors<br>
<br>
Plack::App::WebSocket - WebSocket server as a PSGI application<br>
or<br>
method "new_from_psgi" of Protocol::WebSocket::<u></u>Handshake::=
Server<br>
<br>
Unfortunately I can not find enough documentation to overcome the initial i=
mpact and achieve at least a first prototype.<br>
<br>
If you know of resources such as books, sample code , slides, suggestions t=
o help me, please feel free to report them , thank you.<br>
<br>
As a"extrema ratio" I can use an external reverse proxy (http and=
websocket ) to aggregate the two services but would like to avoid maintain=
ing a single process to manage the application, as it is now .<br>
<br>
<br>
best regards<br>
gdo<br>
<br>
P.S. I use POE for a few years and I will continue to do so for many ...<br=
>
<br>
</blockquote></div><br></div></div>
--001a1136033e02879004ed515b97--