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::RESPONSE (3)

.ds Aq ’

NAME

Protocol::WebSocket::Response - WebSocket Response

CONTENTS

SYNOPSIS



    # Constructor
    $res = Protocol::WebSocket::Response->new(
        host          => example.com,
        resource_name => /demo,
        origin        => file://,
        number1       => 777_007_543,
        number2       => 114_997_259,
        challenge     => "\x47\x30\x22\x2D\x5A\x3F\x47\x58"
    );
    $res->to_string; # HTTP/1.1 101 WebSocket Protocol Handshake
                     # Upgrade: WebSocket
                     # Connection: Upgrade
                     # Sec-WebSocket-Origin: file://
                     # Sec-WebSocket-Location: ws://example.com/demo
                     #
                     # 0st3Rl&q-2ZU^weu

    # Parser
    $res = Protocol::WebSocket::Response->new;
    $res->parse("HTTP/1.1 101 WebSocket Protocol Handshake\x0d\x0a");
    $res->parse("Upgrade: WebSocket\x0d\x0a");
    $res->parse("Connection: Upgrade\x0d\x0a");
    $res->parse("Sec-WebSocket-Origin: file://\x0d\x0a");
    $res->parse("Sec-WebSocket-Location: ws://example.com/demo\x0d\x0a");
    $res->parse("\x0d\x0a");
    $res->parse("0st3Rl&q-2ZU^weu");



DESCRIPTION

Construct or parse a WebSocket response.

ATTRIBUTES

CWhost

CWlocation

CWorigin

CWresource_name

CWsecure

METHODS

CWnew

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

CWparse



    $res->parse($buffer);



Parse a WebSocket response. Incoming buffer is modified.

CWto_string

Construct a WebSocket response.

CWcookie

CWcookies

CWkey1



    $self->key1;



Set or get Sec-WebSocket-Key1 field.

CWkey2



    $self->key2;



Set or get Sec-WebSocket-Key2 field.

CWnumber1



    $self->number1;
    $self->number1(123456);



Set or extract from Sec-WebSocket-Key1 generated number value.

CWnumber2



    $self->number2;
    $self->number2(123456);



Set or extract from Sec-WebSocket-Key2 generated number value.

CWstatus



    $self->status;



Get response status (101).

CWbody



    $self->body;



Get response body.

CWheaders



    my $arrayref = $self->headers;



Get response headers.

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


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

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