Perl ⺠Mojolicious WebSocketã使ã£ããªã¢ã«ã¿ã¤ã ãã£ããã®ãµã³ãã«ã§ããè¤æ°ã®ç»é¢ãéãã¦ãä»ã®ç»é¢ã«æ¸ãè¾¼ã¿ãããã«åæ ããã¾ãã ã½ã¼ã¹ã³ã¼ã use strict; use warnings; use Mojolicious::Lite; my $clients = {}; websocket '/' => sub { my $self = shift; # Client id my $cid = "$self"; # Resist controller $clients->{$cid}{controller} = $self; # Receive message $self->on('message' => sub { my ($self, $message) = @_; # Send message to all clients foreach my
{{#tags}}- {{label}}
{{/tags}}