ninjapeps wrote a reply+100 XP
2d ago
I'm using reverb to listen to the events and update the auction display. Up to three are active at any given time and as soon as one auction closes, it's removed from the display and the next item is put up. Client wants the auctions to close after 3 to 5 seconds of inactivity. I need real-time updates since users won't have time to refresh the page hence reverb.
The way they want this work is weird to me since it's not at all how a site like Ebay works but it's apparently something that's done in Japan and they want to make something like it over in our country.
ninjapeps wrote a reply+100 XP
2d ago
Sorry, I just realized that I call events using broadcast inside an event, not through jobs. Delay doesn't seem to be something I can use with broadcast.
ninjapeps wrote a reply+100 XP
2d ago
Many thanks. This is helpful to know, though I feel that it could still end up with there being too many close auction jobs on the queue. Still much better than what I originally did.
I'm still very new to reverb and went from making a very small scale chat app to a potentially large auction app in the span of one project so I feel out of my depth.
ninjapeps started a new conversation+100 XP
2d ago
I'm trying to make a sort of real time auction site with each auction ideally lasting only as long as people are bidding. If no new bids are detected within a few seconds of the last bid, then the auction will close. Originally, I did this by having an event fire off when someone bids that sleeps for a few seconds and then checks if there are any new bids when it finally runs. It worked but then I realized that the event queue would get clogged by all of these inactivity checker events.
Is there a way to remove specific events from the queue? Or some other better way to do this? Thanks.
ninjapeps wrote a reply+100 XP
5d 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
1w 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
EDIT 2: To my knowledge, no one has made any server changes but now I'm getting this error: https://imgur.com/a/KarIb8U
EDIT 3: Issue has been resolved. Changed proxy pass from 0.0.0.0 to 127.0.0.1 and everything worked properly.
ninjapeps wrote a reply+100 XP
1w 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.