Primus-websocket client side -
im trying make client side websocket using primus framework.
here client side code
<script src="primus/primus.js"></script> <script> // connect current url var primus = primus.connect() primus.on("open", function () { console.log("connected!") }) primus.on("data", function (data) { console.log("data =", data) }) </script>
the error primus.connect not function
thank you.
you need to specify connection.
var primus = primus.connect('ws://localhost:8000');
Comments
Post a Comment