Git Product home page Git Product logo

Comments (3)

sailendra2017 avatar sailendra2017 commented on June 16, 2024 2

@tradzero Thanks for your replay, i am using following steps to resolve my issue.

Steps to resolve "CORS Missing Allow Origin" Error for your Echo Server on Windows 10 with XAMPP

STEP-1: Add "transports: ['websocket', 'polling', 'flashsocket'] // Fix CORS error!" Code inside your Echo Server Setup File (public\js\laravel-echo-setup.js) like following code:

window.Echo = new Echo({
broadcaster: 'socket.io',
host: window.location.hostname + ':6001',
transports: ['websocket', 'polling', 'flashsocket'] // Fix CORS error!
});

STEP-2: Build Your Code Using "npm run dev" command Restart your Laravel Echo Server Using "laravel-echo-server start" command Now check your application, You can't find a CORS error now.

from laravel-echo-redis-socketio.

tradzero avatar tradzero commented on June 16, 2024

@sailendra2017 sorry for reply this so latey, this project is too old and not maintaining, but i try this in my mac, it runs well,
and i found when i run laravel-echo-server init, it seems provide cors settings.
Here is my laravel-echo-server.json file. you can refer to this.

{
	"authHost": "http://localhost",
	"authEndpoint": "/broadcasting/auth",
	"clients": [],
	"database": "redis",
	"databaseConfig": {
		"redis": {},
		"sqlite": {
			"databasePath": "/database/laravel-echo-server.sqlite"
		}
	},
	"devMode": true,
	"host": null,
	"port": "6001",
	"protocol": "http",
	"socketio": {},
	"secureOptions": 67108864,
	"sslCertPath": "",
	"sslKeyPath": "",
	"sslCertChainPath": "",
	"sslPassphrase": "",
	"subscribers": {
		"http": true,
		"redis": true
	},
	"apiOriginAllow": {
		"allowCors": true,
		"allowOrigin": "http://localhost:80",
		"allowMethods": "GET, POST",
		"allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
	}
}

from laravel-echo-redis-socketio.

sailendra2017 avatar sailendra2017 commented on June 16, 2024

@tradzero Thanks for your replay.I am using following steps to resolve my issue and its working for me

@sailendra2017 sorry for reply this so latey, this project is too old and not maintaining, but i try this in my mac, it runs well,
and i found when i run laravel-echo-server init, it seems provide cors settings.
Here is my laravel-echo-server.json file. you can refer to this.

{
	"authHost": "http://localhost",
	"authEndpoint": "/broadcasting/auth",
	"clients": [],
	"database": "redis",
	"databaseConfig": {
		"redis": {},
		"sqlite": {
			"databasePath": "/database/laravel-echo-server.sqlite"
		}
	},
	"devMode": true,
	"host": null,
	"port": "6001",
	"protocol": "http",
	"socketio": {},
	"secureOptions": 67108864,
	"sslCertPath": "",
	"sslKeyPath": "",
	"sslCertChainPath": "",
	"sslPassphrase": "",
	"subscribers": {
		"http": true,
		"redis": true
	},
	"apiOriginAllow": {
		"allowCors": true,
		"allowOrigin": "http://localhost:80",
		"allowMethods": "GET, POST",
		"allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
	}
}

from laravel-echo-redis-socketio.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.