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?

"You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."

In reply to POE and Websockets by cavac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.