ninjapeps wrote a reply+100 XP
9h ago
Someone on a different forum suggested that there could be a connection issue since there were repeated reconnection attempts every few seconds. Screenshot of dev tools output added to the post.
ninjapeps started a new conversation+100 XP
3d ago
I have a site that uses reverb. Events are working just fine on my machine. However, it doesn't receive anything once uploaded to the dev server.
window.addEventListener('DOMContentLoaded', function() {
window.Echo.channel('makebid')
.listen('MakeBid', (event) => {
console.log('bid');
})
window.Echo.channel('closeauction')
.listen('EndAuction', (event) => {
console.log('end');
})
});
Nothing got output to console.
Supervisor is set up to run reverb and queue. The logs aren't displaying any errors from reverb. The queue log is showing events running and completing. Browser is able to connect to the websocket.
What else could be causing this? I don't know what else I need to check in order to properly debug this.
EDIT: I was informed elsewhere that there appears to be a connection issue since there are repeated reconnection attempts shown on dev tools. Not sure how to add images here so screenshot here: https://imgur.com/a/BZW9d5Z
And in case there could be an issue with my nginx config: https://docs.google.com/document/d/1_EDmIVutr0Ol1ARw3L8BIdqjsAbd-S8chEzaQbnxd5E/edit?tab=t.0
ninjapeps wrote a reply+100 XP
3d ago
I had already solved this a while ago and it turned out the only thing I had to do was run npm run build. After doing that, everything ran just fine.
Yes, I believe that error came from supervisor. 8080 was unavailable and 6001 was the port I kept seeing tutorials recommend so I changed it to that.
As for the nginx configurations, most were defaults provided by the server and the ones for reverb were taken from a tutorial.
ninjapeps wrote a reply+100 XP
1mo ago
Yes, reverb is on the same server.
To my knowledge, there's no firewall blocking either 8080 or 6001.
User is authenticated.
ninjapeps started a new conversation+100 XP
1mo ago
(I keep getting a note saying I can't post links yet even though there aren't any links in my post so I've replaced http with hype)
I've got reverb working on my local machine. Now I'm having difficulty getting it to work on the server. I think I've finally gotten supervisor to run properly already so now my only issue is that the sockets can't be read. In the network tab of dev tools, the ws links all have the domain localhost:8080 and a status of blocked.
Not sure if the issue is with my env values
REVERB_APP_ID=396160
REVERB_APP_KEY=ujjxjmewenx3ruqys4bf
REVERB_APP_SECRET=ebqtdneudtyu3vategoj
REVERB_SERVER_HOST=127.0.0.1
REVERB_SERVER_PORT=6001
REVERB_HOST="\<my site's url\>"
REVERB_PORT=443
REVERB_SCHEME=https
BROADCAST_CONNECTION=reverb
or with my Nginx config
server {
listen 80;
listen \[::\]:80;
listen 443 quic;
listen 443 ssl;
listen \[::\]:443 quic;
listen \[::\]:443 ssl;
http2 on;
http3 off;
{{ssl_certificate_key}}
{{ssl_certificate}}
server_name \<my site's url\>;
{{root}}
{{nginx_access_log}}
{{nginx_error_log}}
if ($scheme != "https") {
rewrite ^ hypes//$host$uri permanent;
}
location \~ /.well-known {
auth_basic off;
allow all;
}
{{settings}}
try_files $uri $uri/ /index.php?$args;
index index.php index.html;
location \~ \\.php$ {
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files $uri =404;
fastcgi_read_timeout 3600;
fastcgi_send_timeout 3600;
fastcgi_param HTTPS $fastcgi_https;
fastcgi_pass 127.0.0.1:{{php_fpm_port}};
fastcgi_param PHP_VALUE "{{php_settings}}";
}
location \~\* ^.+\\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ {
add_header Access-Control-Allow-Origin "\*";
expires max;
access_log off;
}
if (-f $request_filename) {
break;
}
location /app/ {
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass hype://0.0.0.0:6001;
}
location /apps {
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass hype://0.0.0.0:6001;
}
}
I can't use 8080 because I get this error when I try:
Failed to listen on "tcp://127.0.0.1:8080": Address already in use (EADDRINUSE)
Any help would be appreciated. Thank you.
EDIT: I forgot I made this thread. Turned out the only reason for my problem was that I had to run npm run build again. After that, it worked properly.