cavac has asked for the wisdom of the Perl Monks concerning the following question:
I need your help with POE.
My problem is this: My software is doing some TCP-Proxying with VNC-Connections as part of a larger system. Clients are web-based.
To tell the truth, i hacked the whole web based VNC subsystem together in a few days when our main remote control server (used by external partners) finally broke down. Worked like a charm for two years now. But the code is a mess and i'm in the middle of cleaning it up and streamlining it.
For HTML4 + Java Applet i'm currently doing this (grabbed it from PerlMonks if memory serves correctly):
use POE; use POE::Filter::Stream; use POE::Filter::Line; use POE::Component::Proxy::TCP; print "Starting proxy for " . $ARGV[0] . " at port " . $ARGV[1] . "\n" +; $|++; $0 = "vnctunnel " . $ARGV[0] . " source port " . $ARGV[1]; POE::Component::Proxy::TCP->new (Alias => "ProxyServerSessionAlias", Port => $ARGV[1], OrigPort => 5900, OrigAddress => $ARGV[0], # DataFromClient => sub {print "From client:", shift(), "\n";}, # DataFromServer => sub {print "From server:", shift(), "\n";}, RemoteClientFilter => "POE::Filter::Stream", RemoteServerOutputFilter => "POE::Filter::Stream", RemoteServerInputFilter => "POE::Filter::Stream" ); $poe_kernel->run(); exit 0
For HTML5 i'm using NoVNC and the included Python-script to make a websocket proxy.
What i want to do is unify all functionality into a single Perl script and call it with an additional argument to say which HTML-Version the client uses). This way i could streamline my master process big time. And i wont have Python code in my Perl project that i don't even know how to debug.
For the last few days i been scratching my head, reading documentation and seemingly trying to break the world record in facepalms per hours.
I found Protocol::WebSocket and it comes with a simple POE example script, though not a proxy.
Problem is, i also found out that i can't wrap my head around how POE works. Drew a complete blank. Writers block. Whatever... (insert facepalm here)
Can anybody help me? Please?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: POE and Websockets
by rcaputo (Chaplain) on Jun 24, 2012 at 21:47 UTC | |
by cavac (Prior) on Jun 25, 2012 at 14:41 UTC | |
|
Re: POE and Websockets
by zentara (Cardinal) on Jun 25, 2012 at 09:56 UTC | |
by cavac (Prior) on Jun 25, 2012 at 14:41 UTC | |
|
Re: POE and Websockets
by Anonymous Monk on Jun 24, 2012 at 22:21 UTC |