You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
321 B

  1. #!/usr/bin/perl
  2. use Net::WebSocket::Server;
  3. Net::WebSocket::Server->new(
  4. listen => 8080,
  5. on_connect => sub {
  6. my ($serv, $conn) = @_;
  7. $conn->on(
  8. utf8 => sub {
  9. my ($conn, $msg) = @_;
  10. $conn->send_utf8($msg);
  11. },
  12. );
  13. },
  14. )->start;
  15. 1;