404 error for socket.io on localhost - XAMPP - Laravel 5.5

I am using XAMPP, Window 8.1, Laravel 5.5 on localhost

I wrote code to translate to laravel using a pusher and it works great. Since the pusher is very expensive, I plan to go to socket.io

Added link below in the main blade.

<script src="{{ asset('socket.io-client/dist/socket.io.js') }}"></script>

Also executed this command in cmd

npm install express ioredis socket.io --save

but it shows me the error below.

enter image description here

If you see a screenshot, error 404 for the url is

http: // localhost: 1234 / socket.io /? EIO = 3 & transport = polling & t = M4VVdoo

but my url

http: // localhost: 1234 / my / learning / public / socket.io /? EIO = 3 & transport = polling & t = M4VVdoo

Any idea why this is happening?

+3
source share
2 answers

I needed to install below packages.

npm install -g laravel-echo-server

,

, js .

<script src="http://{{ Request::getHost() }}:6001/socket.io/socket.io.js"></script>
+3

http://localhost:1234/my/learning/public/socket.io/?EIO=3&transport=polling&t=M4VVdoo , directiry . - .htaccess, mod_rewrite nginx - try files . ,

0

Source: https://habr.com/ru/post/1691858/


All Articles