this frustrating thing have ever encountered, sadly it's stupid did.
here links 3 things i'm using:
here problem: website continually hitting route: http://192.168.10.10:6001/socket.io
. don't know why hitting route, because havn't defined socket.io
part anywhere in code. here code used in bootstrap.js instantiate laravel echo.
import echo "laravel-echo" window.echo = new echo({ broadcaster: 'socket.io', host: 'http://192.168.10.10:6001' });
and code in socket.js file (node.js):
var echo = require('laravel-echo-server'); var options = { authhost: 'http://192.168.10.10', authpath: '/broadcasting/auth', host: 'http://192.168.10.10', port: 6001 }; echo.run(options);
so far, there nothing here possibly going wrong. here error message links cdn. strange thing changing window.echo
host changes domain, don't know how change socket.io part.
this makes wonder, hard coded somewhere in socket.io file? first time using socket.io, have no way know. maybe after put in cdn there setup need do? laravel docs says add script tag, , laravel known having fantastic documentation.
any expertise appreciated, enlighten me!
update
mmmtroy suggested start socket.io server in vm instead of regular computer. made perfect sense, , issue. having problem. before, start server (on regular computer) , say: echoserver: "server running @ http://192.168.10.10:6001"
. now, when attempt start server on vm, returns error:
/home/vagrant/projects/blog/node_modules/laravel-echo-server/dist/echo-server.js:159 emitpresenceevents(socket, channel, members, member, action = null) { ^ syntaxerror: unexpected token = @ exports.runinthiscontext (vm.js:53:16) @ module._compile (module.js:387:25) @ object.module._extensions..js (module.js:422:10) @ module.load (module.js:357:32) @ function.module._load (module.js:314:12) @ module.require (module.js:367:17) @ require (internal/module.js:20:19) @ object.<anonymous> (/home/vagrant/projects/blog/node_modules/laravel-echo-server/dist/index.js:2:23) @ module._compile (module.js:413:34) @ object.module._extensions..js (module.js:422:10)
what should error? looked @ laravel-echo-server emitpresenceevents function had no idea going on.
thanks.
fixed!
i fixed it, had node version. updated homesteads node latest version , fixed it.
for me, have start socket virtual machine, rather local setup. try starting server root of project via virtual machine (homestead/vagrant) rather computer's normal folder structure.
Comments
Post a Comment