Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Problem when trying a http url #55

Open
mightyx opened this issue Dec 15, 2017 · 1 comment
Open

Problem when trying a http url #55

mightyx opened this issue Dec 15, 2017 · 1 comment

Comments

@mightyx
Copy link

mightyx commented Dec 15, 2017

Hey I have a dump question maybe. I 'm trying with a https://ws.somedomain.de url on Port 443

`use Protocol::WebSocket::Client;

my $client = Protocol::WebSocket::Client->new(url => 'ws://ws.somedomain.de:443');

Sends a correct handshake header

$client->connect;

Register on connect handler

$client->on(
connect => sub {
$client->write('hi there');
}
);

Parses incoming data and on every frame calls on_read

$client->read($reply);
print "$reply\n";

Sends correct close header

$client->disconnect;`

And I get the following error:
Can't use an undefined value as a subroutine reference at /Library/Perl/5.18/Protocol/WebSocket/Client.pm line 103.

Is it possible to access an websocket through https? I also tried ws://somedomain.de:443 / ws://https://ws.somedomain.de:443`

@vti
Copy link
Owner

vti commented Dec 15, 2017

Looks like you're missing on_write callback. Check https://github.com/vti/protocol-websocket/blob/master/util/wsconsole#L64 for example.

Let me know the result :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants