File tree Expand file tree Collapse file tree 5 files changed +205
-0
lines changed Expand file tree Collapse file tree 5 files changed +205
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ stopword = Miyagawa
142
142
stopword = OIDs
143
143
stopword = OpenLDAP
144
144
stopword = Punycode
145
+ stopword = WebSocket
145
146
stopword = relativize
146
147
stopword = Tatsuhiko
147
148
stopword = TCP
Original file line number Diff line number Diff line change @@ -1223,6 +1223,18 @@ separated by dots. A C<URI> object belonging to this namespace has an
1223
1223
additional method called $uri->oid that can be used to get/set the oid
1224
1224
value. In a list context, oid numbers are returned as separate elements.
1225
1225
1226
+ =item B<ws > :
1227
+
1228
+ The <ws> URI scheme is specified in L<RFC 6455|http://tools.ietf.org/html/rfc6455> .
1229
+ The C<WebSocket > Protocol enables two-way communication between a client
1230
+ running untrusted code in a controlled environment to a remote host
1231
+ that has opted-in to communications from that code.
1232
+
1233
+ =item B<wss > :
1234
+
1235
+ The I<wss > URI scheme is specified in L<RFC 6455|http://tools.ietf.org/html/rfc6455> as well.
1236
+ The scheme is used to reference C<WebSocket > servers through SSL connections.
1237
+
1226
1238
=back
1227
1239
1228
1240
=head1 CONFIGURATION VARIABLES
Original file line number Diff line number Diff line change
1
+ package URI::ws ;
2
+
3
+ use strict;
4
+ use warnings;
5
+
6
+ our $VERSION = ' 5.33' ;
7
+
8
+ use parent ' URI::http' ;
9
+
10
+ 1;
11
+ __END__
12
+
13
+ =head1 NAME
14
+
15
+ URI::ws - URI scheme for WebSocket Identifiers
16
+
17
+ =head1 VERSION
18
+
19
+ Version 5.20
20
+
21
+ =head1 SYNOPSIS
22
+
23
+ use URI::ws;
24
+
25
+ my $uri = URI->new('ws://example.com/');
26
+
27
+ =head1 DESCRIPTION
28
+
29
+ This module implements the C<ws: > URI scheme defined in L<RFC 6455|http://tools.ietf.org/html/rfc6455> .
30
+
31
+ =head1 SUBROUTINES/METHODS
32
+
33
+ This module inherits the behaviour of L<URI::http|URI::http> .
34
+
35
+ =head1 DIAGNOSTICS
36
+
37
+ See L<URI|URI>
38
+
39
+ =head1 CONFIGURATION AND ENVIRONMENT
40
+
41
+ See L<URI|URI#CONFIGURATION-VARIABLES> and L<URI|URI#ENVIRONMENT-VARIABLES>
42
+
43
+ =head1 DEPENDENCIES
44
+
45
+ None
46
+
47
+ =head1 INCOMPATIBILITIES
48
+
49
+ None reported
50
+
51
+ =head1 BUGS AND LIMITATIONS
52
+
53
+ See L<URI|URI#BUGS>
54
+
55
+ =head1 SEE ALSO
56
+
57
+ L<RFC 3507|http://tools.ietf.org/html/rfc3507>
58
+
59
+ =head1 AUTHOR
60
+
61
+ David Dick, C<< <ddick at cpan.org> >>
62
+
63
+ =head1 LICENSE AND COPYRIGHT
64
+
65
+ Copyright 2016 David Dick.
66
+
67
+ This program is free software; you can redistribute it and/or modify it
68
+ under the terms of either: the GNU General Public License as published
69
+ by the Free Software Foundation; or the Artistic License.
70
+
71
+ See L<http://dev.perl.org/licenses/> for more information.
Original file line number Diff line number Diff line change
1
+ package URI::wss ;
2
+
3
+ use strict;
4
+ use warnings;
5
+
6
+ our $VERSION = ' 5.33' ;
7
+
8
+ use parent ' URI::https' ;
9
+
10
+ 1;
11
+ __END__
12
+
13
+ =head1 NAME
14
+
15
+ URI::wss - URI scheme for WebSocket Identifiers
16
+
17
+ =head1 VERSION
18
+
19
+ Version 5.20
20
+
21
+ =head1 SYNOPSIS
22
+
23
+ use URI::wss;
24
+
25
+ my $uri = URI->new('wss://example.com/');
26
+
27
+ =head1 DESCRIPTION
28
+
29
+ This module implements the C<wss: > URI scheme defined in L<RFC 6455|http://tools.ietf.org/html/rfc6455> .
30
+
31
+ =head1 SUBROUTINES/METHODS
32
+
33
+ This module inherits the behaviour of L<URI::https|URI::https> .
34
+
35
+ =head1 DIAGNOSTICS
36
+
37
+ See L<URI|URI>
38
+
39
+ =head1 CONFIGURATION AND ENVIRONMENT
40
+
41
+ See L<URI|URI#CONFIGURATION-VARIABLES> and L<URI|URI#ENVIRONMENT-VARIABLES>
42
+
43
+ =head1 DEPENDENCIES
44
+
45
+ None
46
+
47
+ =head1 INCOMPATIBILITIES
48
+
49
+ None reported
50
+
51
+ =head1 BUGS AND LIMITATIONS
52
+
53
+ See L<URI|URI#BUGS>
54
+
55
+ =head1 SEE ALSO
56
+
57
+ L<RFC 3507|http://tools.ietf.org/html/rfc3507>
58
+
59
+ =head1 AUTHOR
60
+
61
+ David Dick, C<< <ddick at cpan.org> >>
62
+
63
+ =head1 LICENSE AND COPYRIGHT
64
+
65
+ Copyright 2016 David Dick.
66
+
67
+ This program is free software; you can redistribute it and/or modify it
68
+ under the terms of either: the GNU General Public License as published
69
+ by the Free Software Foundation; or the Artistic License.
70
+
71
+ See L<http://dev.perl.org/licenses/> for more information.
Original file line number Diff line number Diff line change
1
+ use strict;
2
+ use warnings;
3
+
4
+ use Test::More tests => 16;
5
+
6
+ use URI ();
7
+
8
+ my $u = URI-> new(" <ws://www.example.com/path?q=fôo>" );
9
+
10
+ # print "$u\n";
11
+ is($u , " ws://www.example.com/path?q=f%F4o " );
12
+
13
+ is($u -> port, 80);
14
+
15
+ # play with port
16
+ my $old = $u -> port(8080);
17
+ ok($old == 80 && $u eq " ws://www.example.com:8080/path?q=f%F4o " );
18
+
19
+ $u -> port(80);
20
+ is($u , " ws://www.example.com:80/path?q=f%F4o " );
21
+
22
+ $u -> port(" " );
23
+ ok($u eq " ws://www.example.com:/path?q=f%F4o " && $u -> port == 80);
24
+
25
+ $u -> port(undef );
26
+ is($u , " ws://www.example.com/path?q=f%F4o " );
27
+
28
+ my @q = $u -> query_form;
29
+ is_deeply(\@q , [" q" , " fôo" ]);
30
+
31
+ $u -> query_form(foo => " bar" , bar => " baz" );
32
+ is($u -> query, " foo=bar&bar=baz" );
33
+
34
+ is($u -> host, " www.example.com" );
35
+
36
+ is($u -> path, " /path" );
37
+
38
+ ok(!$u -> secure);
39
+
40
+ $u -> scheme(" wss" );
41
+ is($u -> port, 443);
42
+
43
+ is($u , " wss://www.example.com/path?foo=bar&bar=baz" );
44
+
45
+ ok($u -> secure);
46
+
47
+ $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" );
48
+ is($u -> canonical, " ws://example.com/pub/a/2001/08/27/bjornstad.html" );
49
+
50
+ ok($u -> has_recognized_scheme);
You can’t perform that action at this time.
0 commit comments