I'm getting a SyntaxError: An invalid or illegal string was specified
, while trying to connect to a WebSocket on Firefox.
<!doctype html>
<html>
<head><meta charset="utf-8"></head>
<body>
<script>
var socket = new WebSocket('127.0.0.1:1234');
</script>
</body>
</html>
Why do I get this error?
It seems like the scheme is mandatory when trying to connect to a WebSocket, so this:
var socket = new WebSocket('ws://127.0.0.1:1234');
works just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With