Comments (14)
Try using the .pem files generated by LetsEncrypt instead - Source
Your options (either through JSON or the CLI) should instead look like this:
var options = {
authHost: 'https://example.org',
host: 'https://example.org',
port: '6001',
sslCertPath: ' /etc/letsencrypt/live/www.example.org/fullchain.pem',
sslKeyPath: '/etc/letsencrypt/live/www.example.org/privkey.pem'
};
from laravel-echo-server.
@tlaverdure could you link to any discussion online you're having with Taylor about this issue as this was the reason I decided to abandon using SSL and stick with regular http.
Having the SSL directories change every month when let's encrypt updates is a very big hassle.
Maybe if forge sent a callback to your server after a successful SSL update, containing the new paths to the SSL files we could do our own processing etc?
from laravel-echo-server.
+1
Everything is working fine on local with homestead, but not working on server over HTTPS.
from laravel-echo-server.
Are you guys including full paths to your your ssl certificate files?
from laravel-echo-server.
Yes, I believe so. Here is what I have.
var options = {
authHost: 'https://mydomain.com',
host: 'https://mydomain.com',
port: '6001',
sslCertPath: '/etc/nginx/ssl/nginx.crt',
sslKeyPath: '/etc/nginx/ssl/nginx.key'
};
from laravel-echo-server.
Hmmm. I haven't fully tested this out on a remote server :) so bear with me. I wonder if this may be a permissions issue. Usually files and directories in the etc
directory are only accessible by the root user. Could you try running with sudo or using a root user if you can?
from laravel-echo-server.
I just tried running
sudo node socket.js
and it still didn't seem to work for me. I'm seeing "ERR_CONNECTION_REFUSED" in my Chrome console.
from laravel-echo-server.
Just for a little bit of additional information. I'm currently running a LEMP setup on Laravel Forge. I'm using a key from Let's Encrypt which is automatically installed within Forge. The path that is being referenced for the keys in my nginx config file is '/etc/nginx/ssl/default/{unique_id}/nginx.crt'. These files, however, are empty and when I tried to use one it threw an error (something about it not being able to find the file) when I went to start the socket. I assumed there was some sort of connection being made between these files, and the files I'm referencing in my example in one of my previous comments. When I changed the socket.js file to reference the files above, it would allow me to start the socket just fine.
from laravel-echo-server.
I made a couple changes and now am start to see the following "ERR_INSECURE_RESPONSE".
from laravel-echo-server.
Gotcha, yeah if the files are not found, the server will not run properly. In the next release there will be some better error logging to help diagnose these type of things.
On Laravel forge, when certificates are renewed, it looks like the directory of the certificate files change. I understand that it may be cumbersome to keep up with these, but the paths will need to remain updated in order to run the server with SSL. As this falls outside of the actual configuration of the server, and more so the location of the ssl certificates files I'm going to close this and ping @taylorotwell.
A possible solution for Laravel Forge and other instances of this issue may be to perform an "atomic" deployment of the certificates by creating a symlink when the SSL certificates are installed.
So each time the certificate is refreshed, the active directory:
/etc/nginx/ssl/SITE/UNIQUE_ID
would be symlinked to:
/home/forge/ssl/SITE/
from laravel-echo-server.
Thanks for the suggestions @tlaverdure. I was able to get it working with a combination of setting the ssl files to the ones located within the unique_id folders, combined with using sudo when running "sudo node socket.js".
I'm not able to get it running however using pm2. Even when I run sudo pm2 start socket.js it doesn't seem to work. This seems especially important since I seem to be getting an error "Unexpected token a in JSON at position 0" quite often that crashes the service.
Unexpected token a in JSON at position 0
at Object.parse (native)
at Redis._redisPubSub.on (/home/forge/default/node_modules/laravel-echo-server/dist/echo-server.js:66:28)
from laravel-echo-server.
having the same problem here.
Am able to get it to work over https if I run sudo laravel-echo-server start with the json config file pointing to the /etc/nginx files. But can't get it to run using PM2
Also hadn't even realized that the ssl cert path will be changing on a periodic basis which is a big hassle for sure.
in the past I managed to get something similar to this to work by using supervisor so I'll look into that
if anyone knows how to get this to work with PM2 or finds a clean solution to the changing paths please let me know.
I guess sudo is only needed because the ssl cert is located in a root-owned path so a workaround that might be useful too
from laravel-echo-server.
I same issue ... pls help me
from laravel-echo-server.
For me in local environment it didn't work with host: "https://example.org"
. I changed it back to host: null
, but this value should be in: authHost: "https://example.org"
from laravel-echo-server.
Related Issues (20)
- Is the package compromised? HOT 6
- Laravel-echo-server events listeners custom callbacks
- Redis6 ACL Support HOT 1
- 运行一会,就会中断,提示截图显示的错误 HOT 2
- Cannot find module '../dist/cli' - supervisord
- Redis 6 ACL config HOT 1
- Connection refused on docker
- Laravel Echo Server work and client side error only at server HOT 2
- Is there ways to emit data from client (socket.io-client) to laravel-echo-server? HOT 2
- Laravel Echo PresenceChannel vs listen events doesn't work HOT 2
- 使用Laravel 5.8 广播系统,本地研发没有事情,上线后握手阶段,第一次OK,第二次报502,第三次报session id unknown,现在不知道是那个地方出问题了?求帮助 HOT 1
- Is `tlaverdure/laravel-echo-server` abandoned? HOT 6
- Is the cors configuration even working? HOT 1
- echo server socket.io.js error
- support redis cluster
- Redis TTL key is store forever
- CSRF token mismatch after session timeout
- npx laravel-echo-server start HOT 1
- Unable to join channel. Member data for presence channel missing HOT 1
- Is this project compatible with Socket.io v4? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-echo-server.