Net::WebSocket::HTTP_R - logic for HTTP::Request & HTTP::Response
Client:
my $resp = HTTP::Response->parse_string($http_response); my $handshake = Net::WebSocket::Handshake::Client->new( .. ); Net::WebSocket::HTTP_R::handshake_consume_response( $handshake, $resp );
Server:
my $req = HTTP::Request->parse_string($http_request); my $handshake = Net::WebSocket::Handshake::Server->new( .. ); Net::WebSocket::HTTP_R::handshake_consume_request( $handshake, $req );
Net::WebSocket is agnostic as to which tools an implementor may use to parse HTTP headers. CPAN offers a number of options for doing this, and different applications may have varying reasons to prefer one or the other—or an entirely different approach altogether.
This module provides convenient logic for the HTTP::Request and HTTP::Response CPAN modules. Any implementation that uses one of these modules (or a compatible implementation) can use Net::WebSocket::HTTP_R and save a bit of time.
To install Net::WebSocket, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::WebSocket
CPAN shell
perl -MCPAN -e shell install Net::WebSocket
For more information on module installation, please visit the detailed CPAN module installation guide.