The dart:html
library is used on the client-side and can be compiled to JavaScript.
Use dart:io
for server-side code.
In a typical setup, you have a web server listening to WebSocket connections from the client, in which case you would use the one from dart:html
. But of course you can also initiate WebSocket connections at the server if you ever need :)