Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

POE HTTP server with WebSocket channel

28 views
Skip to first unread message

Guido Brugnara

unread,
Dec 11, 2013, 9:38:13 AM12/11/13
to p...@perl.org
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 ...

Konstantin Yakunin

unread,
Dec 12, 2013, 2:33:01 AM12/12/13
to Guido Brugnara, p...@perl.org
Hello,

Try Plack::Builder

use Plack::Builder;

builder {

}



2013/12/11 Guido Brugnara <g...@leader.it>

Guido Brugnara

unread,
Dec 12, 2013, 3:23:54 AM12/12/13
to p...@perl.org
Il 12/12/2013 08:33, Konstantin Yakunin ha scritto:
Hello,

Try Plack::Builder

use Plack::Builder;

builder {

}


I like! Thanks.

I tried to install POEx-Role-PSGIServer from CPAN but points out the lack of the package POEx-Role-SessionInstantiation [1]
Here ( https://rt.cpan.org/Public/Bug/Display.html?id=69745 ) the author of [1] warns you deleted the package from CPAN because it is no longer compatible with the latest versions of Moose :-(
So, The POEx-... packages are all considered experimental/broken?
What could I use as a PSGI server, along with POE in a single task?
____
gdo 



2013/12/11 Guido Brugnara <g...@leader.it>
===CUT===

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
===CUT===



Nick Perez

unread,
Dec 13, 2013, 4:24:18 AM12/13/13
to Guido Brugnara, p...@perl.org
Hey Guido,

I am the author of those modules. And yeah, they are broken and
experimental. I was attempting to create an unholy amalgamation of
MooseX::Declare and POE. It was an abomination that needed to be killed
with fire. I should make sure I clean up those modules.

That said, I had started hacking on a replacement stack on top of
Reflex, but lost interest. You're welcome to pick it up and finish it
if that is your cup of tea.

http://nickandperla.net/gitweb/?p=reflexive-role-psgiserver.git

It is based on top of Reflexive::Role::TCPServer

https://metacpan.org/pod/Reflexive::Role::TCPServer

If you have any questions, feel free to give me a shout on
irc.perl.org/#poe or #reflex

You can also contact me via XMPP at this same address.


On Thu, 12 Dec 2013 09:23:54 +0100
Guido Brugnara <g...@leader.it> wrote:

> Il 12/12/2013 08:33, Konstantin Yakunin ha scritto:
> > Hello,
> >
> > Try Plack::Builder
> >
> > use Plack::Builder;
> >
> > builder {
> >
> > }
> >
>
> I like! Thanks.
>
> I tried to install POEx-Role-PSGIServer from CPAN but points out the
> lack of the package POEx-Role-SessionInstantiation [1]
> Here ( https://rt.cpan.org/Public/Bug/Display.html?id=69745 ) the
> author of [1] warns you deleted the package from CPAN because it is
> no longer compatible with the latest versions of Moose :-(
> So, The POEx-... packages are all considered experimental/broken?
> What could I use as a PSGI server, along with POE in a single task?
> ____
> gdo
>
> >
> >
> > 2013/12/11 Guido Brugnara <g...@leader.it <mailto:g...@leader.it>>
> >
> > ===CUT===
> > 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
> > ===CUT===
> >
> >
>



--

Nicholas Perez
XMPP/Email: ni...@nickandperla.net
https://metacpan.org/author/NPEREZ
http://github.com/nperez

Guido Brugnara

unread,
Dec 14, 2013, 3:12:34 AM12/14/13
to p...@perl.org
Il 13/12/2013 10:24, Nick Perez ha scritto:
Hey Guido,

I am the author of those modules. And yeah, they are broken and
experimental. I was attempting to create an unholy amalgamation of
MooseX::Declare and POE. It was an abomination that needed to be killed
with fire. I should make sure I clean up those modules. 

That said, I had started hacking on a replacement stack on top of
Reflex, but lost interest. You're welcome to pick it up and finish it
if that is your cup of tea.

http://nickandperla.net/gitweb/?p=reflexive-role-psgiserver.git

The server is not responding.


It is based on top of Reflexive::Role::TCPServer

https://metacpan.org/pod/Reflexive::Role::TCPServer

I don't hide my limit to understand Refrex and derivatives, probably because it does not use Moose but only in few occasions, without looking under the hood.
I was hoping to avoid the use of modeling alternatives to POE, but if I have no choice, I will assess this alternative also.

If you have any questions, feel free to give me a shout on
irc.perl.org/#poe or #reflex

You can also contact me via XMPP at this same address.

thank you very much
Guido

Guido Brugnara

unread,
Dec 14, 2013, 3:16:53 AM12/14/13
to p...@perl.org
Il 14/12/2013 09:12, Guido Brugnara ha scritto:
I don't hide my limit to understand Refrex and derivatives, probably because it does not use Moose but only in few occasions, without looking under the hood.


... because I don't not use Moose every day, but only ...

0 new messages