-
Notifications
You must be signed in to change notification settings - Fork 51
Adding WebSocket (ws) URI #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
david-dick
wants to merge
6
commits into
libwww-perl:master
Choose a base branch
from
david-dick:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
63fd496
Adding WebSocket (ws) URI
david-dick 4127ac2
Update lib/URI/wss.pm
david-dick 82bd203
Update lib/URI/ws.pm
david-dick 141f525
Update lib/URI/wss.pm
david-dick 121d988
Update lib/URI/ws.pm
david-dick faef611
Merge branch 'master' into master
david-dick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package URI::ws; | ||
|
||
use strict; | ||
use warnings; | ||
|
||
our $VERSION = '5.33'; | ||
|
||
use parent 'URI::http'; | ||
|
||
1; | ||
__END__ | ||
|
||
=head1 NAME | ||
|
||
URI::ws - URI scheme for WebSocket Identifiers | ||
|
||
=head1 VERSION | ||
|
||
Version 5.20 | ||
|
||
=head1 SYNOPSIS | ||
|
||
use URI::ws; | ||
|
||
my $uri = URI->new('ws://example.com/'); | ||
|
||
=head1 DESCRIPTION | ||
|
||
This module implements the C<ws:> URI scheme defined in L<RFC 6455|http://tools.ietf.org/html/rfc6455>. | ||
|
||
=head1 SUBROUTINES/METHODS | ||
|
||
This module inherits the behaviour of L<URI::http|URI::http>. | ||
|
||
=head1 DIAGNOSTICS | ||
|
||
See L<URI|URI> | ||
|
||
=head1 CONFIGURATION AND ENVIRONMENT | ||
|
||
See L<URI|URI#CONFIGURATION-VARIABLES> and L<URI|URI#ENVIRONMENT-VARIABLES> | ||
|
||
=head1 DEPENDENCIES | ||
|
||
None | ||
|
||
=head1 INCOMPATIBILITIES | ||
|
||
None reported | ||
|
||
=head1 BUGS AND LIMITATIONS | ||
|
||
See L<URI|URI#BUGS> | ||
|
||
=head1 SEE ALSO | ||
|
||
L<RFC 3507|http://tools.ietf.org/html/rfc3507> | ||
david-dick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
=head1 AUTHOR | ||
|
||
David Dick, C<< <ddick at cpan.org> >> | ||
|
||
=head1 LICENSE AND COPYRIGHT | ||
|
||
Copyright 2016 David Dick. | ||
|
||
This program is free software; you can redistribute it and/or modify it | ||
under the terms of either: the GNU General Public License as published | ||
by the Free Software Foundation; or the Artistic License. | ||
|
||
See L<http://dev.perl.org/licenses/> for more information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package URI::wss; | ||
|
||
use strict; | ||
use warnings; | ||
|
||
our $VERSION = '5.33'; | ||
|
||
use parent 'URI::https'; | ||
|
||
1; | ||
__END__ | ||
|
||
=head1 NAME | ||
|
||
URI::wss - URI scheme for WebSocket Identifiers | ||
|
||
=head1 VERSION | ||
|
||
Version 5.20 | ||
david-dick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
=head1 SYNOPSIS | ||
|
||
use URI::wss; | ||
|
||
my $uri = URI->new('wss://example.com/'); | ||
|
||
=head1 DESCRIPTION | ||
|
||
This module implements the C<wss:> URI scheme defined in L<RFC 6455|http://tools.ietf.org/html/rfc6455>. | ||
|
||
=head1 SUBROUTINES/METHODS | ||
|
||
This module inherits the behaviour of L<URI::https|URI::https>. | ||
|
||
=head1 DIAGNOSTICS | ||
|
||
See L<URI|URI> | ||
|
||
=head1 CONFIGURATION AND ENVIRONMENT | ||
|
||
See L<URI|URI#CONFIGURATION-VARIABLES> and L<URI|URI#ENVIRONMENT-VARIABLES> | ||
|
||
=head1 DEPENDENCIES | ||
|
||
None | ||
|
||
=head1 INCOMPATIBILITIES | ||
|
||
None reported | ||
|
||
=head1 BUGS AND LIMITATIONS | ||
|
||
See L<URI|URI#BUGS> | ||
|
||
=head1 SEE ALSO | ||
|
||
L<RFC 3507|http://tools.ietf.org/html/rfc3507> | ||
david-dick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
=head1 AUTHOR | ||
|
||
David Dick, C<< <ddick at cpan.org> >> | ||
|
||
=head1 LICENSE AND COPYRIGHT | ||
|
||
Copyright 2016 David Dick. | ||
|
||
This program is free software; you can redistribute it and/or modify it | ||
under the terms of either: the GNU General Public License as published | ||
by the Free Software Foundation; or the Artistic License. | ||
|
||
See L<http://dev.perl.org/licenses/> for more information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More tests => 16; | ||
|
||
use URI (); | ||
|
||
my $u = URI->new("<ws://www.example.com/path?q=fôo>"); | ||
|
||
#print "$u\n"; | ||
is($u, "ws://www.example.com/path?q=f%F4o"); | ||
|
||
is($u->port, 80); | ||
|
||
# play with port | ||
my $old = $u->port(8080); | ||
ok($old == 80 && $u eq "ws://www.example.com:8080/path?q=f%F4o"); | ||
|
||
$u->port(80); | ||
is($u, "ws://www.example.com:80/path?q=f%F4o"); | ||
|
||
$u->port(""); | ||
ok($u eq "ws://www.example.com:/path?q=f%F4o" && $u->port == 80); | ||
|
||
$u->port(undef); | ||
is($u, "ws://www.example.com/path?q=f%F4o"); | ||
|
||
my @q = $u->query_form; | ||
is_deeply(\@q, ["q", "fôo"]); | ||
|
||
$u->query_form(foo => "bar", bar => "baz"); | ||
is($u->query, "foo=bar&bar=baz"); | ||
|
||
is($u->host, "www.example.com"); | ||
|
||
is($u->path, "/path"); | ||
|
||
ok(!$u->secure); | ||
|
||
$u->scheme("wss"); | ||
is($u->port, 443); | ||
|
||
is($u, "wss://www.example.com/path?foo=bar&bar=baz"); | ||
|
||
ok($u->secure); | ||
|
||
$u = URI->new("ws://%65%78%61%6d%70%6c%65%2e%63%6f%6d/%70%75%62/%61/%32%30%30%31/%30%38/%32%37/%62%6a%6f%72%6e%73%74%61%64%2e%68%74%6d%6c"); | ||
is($u->canonical, "ws://example.com/pub/a/2001/08/27/bjornstad.html"); | ||
|
||
ok($u->has_recognized_scheme); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.