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

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -