GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PLACK::MIDDLEWARE::SOCKETIO (3)

.ds Aq ’

NAME

Plack::Middleware::SocketIO - Socket.IO middleware DEPRECATED

CONTENTS

SYNOPSIS



    use Plack::Builder;

    builder {
        enable "SocketIO", handler => sub {
            my $self = shift;

            $self->on_message(
                sub {
                    my $self = shift;
                    my ($message) = @_;

                    ...
                }
            );

            $self->send_message({buffer => []});
        };

        $app;
    };

    # or

    builder {
        enable "SocketIO", class => MyApp::Handler, method => run;

        $app;
    };



DESCRIPTION

DEPRECATED. Use PocketIO instead <http://github.com/vti/pocketio>.

Plack::Middleware::SocketIO is a server implmentation of SocketIO in Perl.

    SocketIO

More information about SocketIO you can find on the website <http://socket.io/>, or on the GitHub <https://github.com/LearnBoost/Socket.IO>.

    Transports

All the transports are supported.



    WebSocket
    Adobe(R) Flash(R) Socket
    AJAX long polling
    AJAX multipart streaming
    Forever Iframe
    JSONP Polling



    TLS/SSL

For TLS/SSL a secure proxy is needed. stunnel or App::TLSMe is recommended.

CONFIGURATIONS

resource


    enable "SocketIO",
        resource => socket.io, ...;



Specifies the path prefix under which all the requests are handled. This is done so the rest of your application won’t interfere with Socket.IO specific calls.

handler


    enable "SocketIO",
        handler => sub {
            my $socket = shift;

            $socket->on_message(sub {
                my $socket = shift;
            });

            $socket->send_message(hello);
        };



class or instance, method


    enable "SocketIO",
        class => MyHandler, method => run;

    # or

    enable "SocketIO",
        instance => MyHandler->new(foo => bar), method => run;

    package MyHandler;

    sub new { ...  } # or use Moose, Boose, Goose, Doose

    sub run {
        my $self = shift;

        return sub {

            # same code as above
        }
    }



Loads class using Plack::Util::load_class, creates a new object or uses a passed instance and runs run method expecting it to return an anonymous subroutine.

DEVELOPMENT

    Repository



    http://github.com/vti/plack-middleware-socketio



CREDITS

Socket.IO author(s) and contributors.

AUTHOR

Viacheslav Tykhanovskyi, vti@cpan.org.

COPYRIGHT AND LICENSE

Copyright (C) 2011, Viacheslav Tykhanovskyi

This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PLACK::MIDDLEWARE::SOCKETIO (3) 2011-07-06

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.