Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Apr 30, 2021. It is now read-only.
/protocol-websocketPublic archive

Protocol::WebSocket

License

NotificationsYou must be signed in to change notification settings

vti/protocol-websocket

Repository files navigation

Protocol::WebSocket - WebSocket protocol

SYNOPSIS

# Server sidemy $hs = Protocol::WebSocket::Handshake::Server->new;$hs->parse('some data from the client');$hs->is_done; # tells us when handshake is donemy $frame = $hs->build_frame;$frame->append('some data from the client');while (defined(my $message = $frame->next)) {    if ($frame->is_close) {        # Send close frame back        send(            $hs->build_frame(                type    => 'close',                version => $version            )->to_bytes        );        return;    }    # We got a message!}

DESCRIPTION

Client/server WebSocket message and frame parser/constructor. This module doesnot provide a WebSocket server or client, but is made for using in http serversor clients to provide WebSocket support.

Protocol::WebSocket supports the following WebSocket protocol versions:

draft-ietf-hybi-17 (latest)draft-ietf-hybi-10draft-ietf-hybi-00 (with HAProxy support)draft-hixie-75

By default the latest version is used. The WebSocket version is detectedautomatically on the server side. On the client side you have set aversionattribute to an appropriate value.

Protocol::WebSocket itself does not contain any code and cannot be useddirectly. Instead the following modules should be used:

High-level modules

Server helper class.

Client helper class.

Low-level modules

Server handshake parser and constructor.

Client handshake parser and constructor.

WebSocket frame parser and constructor.

Low level WebSocket request parser and constructor.

Low level WebSocket response parser and constructor.

Low level WebSocket url parser and constructor.

EXAMPLES

For examples on how to useProtocol::WebSocket with various event loops seeexamples/ directory in the distribution.

CREDITS

In order of appearance:

Paul "LeoNerd" Evans

Jon Gentle

Lee Aylward

Chia-liang Kao

Atomer Ju

Chuck Bredestege

Matthew Lien (BlueT)

Joao Orui

Toshio Ito (debug-ito)

Neil Bowers

Michal Špaček

Graham Ollis

Anton Petrusevich

Eric Wastl

Greg Kennedy

AUTHOR

Viacheslav Tykhanovskyi,vti@cpan.org.

COPYRIGHT

Copyright (C) 2010-2018, Viacheslav Tykhanovskyi.

This program is free software, you can redistribute it and/or modify it underthe same terms as Perl 5.10.

About

Protocol::WebSocket

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp