use strict; use warnings; use IO::Socket; use JSON; my $wss = 'ws://gateway'; my $client = IO::Socket->new($wss, 5000, tcp); #most examples use localhost instead # do I do the handshake query here before the loop and then go to the loop and start filtering # responses? while(1){ #filter responses }