Closed ibrahimyaacob92 closed 10 months ago
Just wanted to +1 this, same exact issue. I think it would be better to just take this down. Even when going to the discord for Soketi, no one seems to be able to help.
@ibrahimyaacob92 @shininglove Hi, I think I found a solution, check out my repo. You need to override a Railway port to 6001 and set the host to 0.0.0.0
@Heljas I'll try this right away! What port did you use on the client to connect to this? 6001 or 443?
@shininglove 6001
@Heljas Not sure why I'm not able to connect still, I'll keep trying different methods, do you have snippets of your client and server code you used to connect?
@shininglove Sure, server:
export const pusher = new Pusher({
secret: process.env.SOKETI_APP_SECRET ?? "",
appId: process.env.SOKETI_APP_ID ?? "",
key: process.env.NEXT_PUBLIC_SOKETI_APP_KEY ?? "",
host: process.env.NEXT_PUBLIC_SOKETI_APP_HOST ?? "", //xyz.up.railway.app
cluster: "",
useTLS: true
});
const client = new PusherJS(process.env.NEXT_PUBLIC_SOKETI_APP_KEY ?? "", {
wsHost: process.env.NEXT_PUBLIC_SOKETI_APP_HOST, //xyz.up.railway.app
wsPort: parseInt(process.env.NEXT_PUBLIC_SOKETI_APP_PORT ?? ""), //6001
cluster: "",
disableStats: true,
enabledTransports: ["ws", "wss"],
channelAuthorization: {
endpoint: "/api/realtime/authorize",
transport: "ajax"
}
});
@shininglove Did you override PORT env on Railway? Could you send the error?
@shininglove Did you override PORT env on Railway? Could you send the error?
YOU'RE AWESOME, YOU'RE RIGHT! That was the solution, the problem I was getting into was launching from the template. But I noticed in your repo looked different from the template. I cloned your repo, then manually deployed and overrode the port, and it finally worked!
Thank you so much! I'll share this with other people that were having these same issues.
I'm glad it helped!
Even so, just be careful that the template deploys the 0.x version of Soketi, which is not up-to-date. I created https://github.com/railwayapp-templates/soketi/pull/1, but it was closed.
Sure, that's why I recommend a template from my repo, I also updated Dockerfile to use the latest Soketi version (1.5).
So yeah, this template is certainly out of date. cc @Milo123459 @brody192
Another question – has anyone been able to expose the 9601 port as well as the 6001 port on Railway, to consume usage/metrics info?
OP was initialising the client wrong, TLS is required and the port would be 443.
Strange to see unfriendly behaviour from the maintainers of a paid-for PaaS...
The template is at the very least out of date in that it references a previous major version of Soketi. In upgrading, you will release that many env vars for Soketi have changed.
I'm sorry but neither me or milo maintain any part of railway the platform, nor have we had any involvement in this template.
this template is also not maintained by railway but by a community member.
Oh, I see. Strange that they have community members maintaining repos on their official GH org.
Here's an up-to-date, working Dockerfile:
FROM quay.io/soketi/soketi:1.5.0-16-debian
ARG SOKETI_DEFAULT_APP_ID
ENV SOKETI_DEFAULT_APP_ID=$SOKETI_DEFAULT_APP_ID
ARG SOKETI_DEFAULT_APP_KEY
ENV SOKETI_DEFAULT_APP_KEY=$SOKETI_DEFAULT_APP_KEY
ARG SOKETI_DEFAULT_APP_SECRET
ENV SOKETI_DEFAULT_APP_SECRET=$SOKETI_DEFAULT_APP_SECRET
ENV SOKETI_HOST=0.0.0.0
Strange that they have community members maintaining repos on their official GH org.
The repos I maintain on this org are repos I have created, usually for a template bounty.
Update: I have now been given ownership of the Soketi template and I will be given push permissions on this repo tomorrow. The Template itself has been updated and currently deploys from a forked (and updated) version of this repo, once I have push permissions on this rep it will be updated and the template will be updated to again deploy from this repo.
Update v2: The template now uses this updated repo, I am watching soketi's repo for releases and will do my best to update this repo accordingly
Both the repo and template have been updated
I'm using this template to spin up Soketi Server and hook it up with NextJS application.
Error I'm getting
I've tested the same code with my local soketi server and it works just fine. I'm suspecting something is not right with Railway.. again I'm not 100%. But I'm seeing a number of people also facing this issue but there's not documented solution out there.
Thank you