Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

How to use it over reverse proxy? #46

Closed
leemmoox opened this issue Dec 11, 2018 · 5 comments
Closed

How to use it over reverse proxy? #46

leemmoox opened this issue Dec 11, 2018 · 5 comments

Comments

@leemmoox
Copy link

leemmoox commented Dec 11, 2018

Hello,

I would like to use your package(and replace old laravel-echo-server), but it doesn't work if you need to connect to websocker service running in subdirectory....

for example something like this:
http://yourdomain.com/application_name/ws

I have configured nginx as reverse proxy to redirect any connection from http://yourdomain.com/application_name/ws to websocket running on 6001 . how to configure this URL in laravel-echo?

There is only wsHost and wsPort and I need something like this:

window.Echo = new Echo({
broadcaster: 'pusher',
key: 'your-pusher-key',
wsUrl: 'http://yourdomain.com/application_name/ws',
disableStats: true,
});

Thx

@irazasyed
Copy link
Contributor

Try with wsPath option and pass your endpoint to it. You can find more about other supported config options here.

@acacha
Copy link

acacha commented Dec 13, 2018

Could somebody share a working configuration with Laravel Forge. I'm not sure how to config, my doubts:

  • Use port 6001: we need to open firewall but what more? How to config encryption an what config use in Laravel Echo (Javascript) and what config in PHP Laravel
  • Use Nginx proxy: what config use in Laravel Echo (Javascript) and what config in PHP Laravel? WE need to set SSL config in websockets.php config file ot only in Nginx proxy config?

@stayallive
Copy link
Contributor

stayallive commented Dec 13, 2018

There is a forge specific thread that might be useful: #30

@stefandanaita
Copy link

Here's a very good tutorial of how to get it working: https://alex.bouma.me/installing-laravel-websockets-on-forge/#what-about-cloudflare

@Erutan409
Copy link

Anyone coming here from a google search, take a look at this. Seems pretty straight-forward to shim in with any other previous configurations you may have for this need.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants