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  -  PROTOCOL::WEBSOCKET::REQUEST (3)

.ds Aq ’

NAME

Protocol::WebSocket::Request - WebSocket Request

CONTENTS

SYNOPSIS



    # Constructor
    my $req = Protocol::WebSocket::Request->new(
        host          => example.com,
        resource_name => /demo
    );
    $req->to_string; # GET /demo HTTP/1.1
                     # Upgrade: WebSocket
                     # Connection: Upgrade
                     # Host: example.com
                     # Origin: http://example.com
                     # Sec-WebSocket-Key1: 32 0  3lD& 24+<    i u4  8! -6/4
                     # Sec-WebSocket-Key2: 2q 4  2  54 09064
                     #
                     # x#####

    # Parser
    my $req = Protocol::WebSocket::Request->new;
    $req->parse("GET /demo HTTP/1.1\x0d\x0a");
    $req->parse("Upgrade: WebSocket\x0d\x0a");
    $req->parse("Connection: Upgrade\x0d\x0a");
    $req->parse("Host: example.com\x0d\x0a");
    $req->parse("Origin: http://example.com\x0d\x0a");
    $req->parse(
        "Sec-WebSocket-Key1: 18x 6]8vM;54 *(5:  {   U1]8  z [  8\x0d\x0a");
    $req->parse(
        "Sec-WebSocket-Key2: 1_ tx7X d  <  nw  334J702) 7]o}` 0\x0d\x0a");
    $req->parse("\x0d\x0aTm[K T2u");



DESCRIPTION

Construct or parse a WebSocket request.

ATTRIBUTES

CWhost

CWkey1

CWkey2

CWnumber1

CWnumber2

CWorigin

CWresource_name

METHODS

CWnew

Create a new Protocol::WebSocket::Request instance.

CWnew_from_psgi



    my $env = {
        HTTP_HOST => example.com,
        HTTP_CONNECTION => Upgrade,
        ...
    };
    my $req = Protocol::WebSocket::Request->new_from_psgi($env);



Create a new Protocol::WebSocket::Request instance from PSGI environment.

CWparse



    $req->parse($buffer);
    $req->parse($handle);



Parse a WebSocket request. Incoming buffer is modified.

CWto_string

Construct a WebSocket request.

CWconnection



    $self->connection;



A shortcut for $self-field(’Connection’)>.

CWcookies

CWupgrade



    $self->upgrade;



A shortcut for $self-field(’Upgrade’)>.

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


perl v5.20.3 PROTOCOL::WEBSOCKET::REQUEST (3) 2011-10-25

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