This repository was archived by the owner on Apr 30, 2021. It is now read-only.

Description
For example:
use strict;
use warnings;
use YAML ();
use Protocol::WebSocket::Request;
my $m = Protocol::WebSocket::Request->new;
$m->parse("GET /count/10 HTTP/1.1\x0d\x0a" .
"Upgrade: WebSocket\x0d\x0a" .
"Connection: Upgrade\x0d\x0a" .
"Host: 127.0.0.1:33310\x0d\x0a" .
"Origin: http://127.0.0.1:33310\x0d\x0a" .
"Sec-WebSocket-Key: AVDtAGeqR3jFUwgGmKhDyA==\x0d\x0a" .
"Sec-WebSocket-Version: 13\x0d\x0a" .
"X-Foo: bar\x0d\x0a" .
"X-Baz: abc\x0d\x0a" .
"X-Baz: def\x0d\x0a\x0d\x0a");
print YAML::Dump($m->fields);
prints:
---
connection: Upgrade
host: 127.0.0.1:33310
origin: http://127.0.0.1:33310
sec-websocket-key: AVDtAGeqR3jFUwgGmKhDyA==
sec-websocket-version: 13
upgrade: WebSocket
x-baz: def
x-foo: bar
Note that only the second value for x-baz is available.