yann
yann
Explore posts from servers
RRailway
Created by yann on 9/1/2024 in #✋|help
Postgres and SSL
1. I just went through the process of attaching the volume to the file browser and downloading the root certificate. It works fine, but is quite inconvenient and requires downtime. Do you have plans to make this download a one-click operation that doesn't require disconnecting the volume from the Postgres container? 2. The SSL expiration is set to 820 days. - What happens when it expires? Will all connections to the database fail? - Is it possible to automatically renew the SSL certificate or does someone have to manually restart the Postgres container?
5 replies
RRailway
Created by yann on 12/14/2023 in #✋|help
Run ntfy.sh on Railway
Does anyone run ntfy.sh on Railway and could share their Dockerfile / deploy commands? https://docs.ntfy.sh/install/#docker
19 replies
RRailway
Created by yann on 10/8/2023 in #✋|help
Regions
Will regions continue to be a pro plan feature only?
7 replies
RRailway
Created by yann on 5/4/2023 in #✋|help
Why are failed deployments not removed automatically?
And is there a configuration option to enable this?
18 replies
RRailway
Created by yann on 4/19/2023 in #✋|help
Cannot connect to Node WebSockets deployment - even with custom domain
Very basic server:
import { createServer } from "http";
import { ChatMessage } from "@chat/types";
import { WebSocketServer } from "ws";

function onSocketError(err) {
console.error(err);
}

const server = createServer();
const wss = new WebSocketServer({ noServer: true });

wss.on("connection", (ws, request) => {
console.log("New connection to websocket");

ws.on("error", console.error);

ws.on("message", (data) => {
const msg: ChatMessage = JSON.parse(data.toString());
console.log(`Received message ${msg} from user ${msg.fromId}`);

wss.clients.forEach((client) => {
client.send(JSON.stringify(msg));
});
});
});

server.on("upgrade", function upgrade(request, socket, head) {
console.log("Upgrading to websocket");

socket.on("error", onSocketError);
socket.removeListener("error", onSocketError);

wss.handleUpgrade(request, socket, head, (ws) => {
wss.emit("connection", ws, request);
});
});

server.on("listening", () => {
console.log("Listening on port 8080");
});

server.listen(8080);
import { createServer } from "http";
import { ChatMessage } from "@chat/types";
import { WebSocketServer } from "ws";

function onSocketError(err) {
console.error(err);
}

const server = createServer();
const wss = new WebSocketServer({ noServer: true });

wss.on("connection", (ws, request) => {
console.log("New connection to websocket");

ws.on("error", console.error);

ws.on("message", (data) => {
const msg: ChatMessage = JSON.parse(data.toString());
console.log(`Received message ${msg} from user ${msg.fromId}`);

wss.clients.forEach((client) => {
client.send(JSON.stringify(msg));
});
});
});

server.on("upgrade", function upgrade(request, socket, head) {
console.log("Upgrading to websocket");

socket.on("error", onSocketError);
socket.removeListener("error", onSocketError);

wss.handleUpgrade(request, socket, head, (ws) => {
wss.emit("connection", ws, request);
});
});

server.on("listening", () => {
console.log("Listening on port 8080");
});

server.listen(8080);
I connect in the client with
const newWS = new WebSocket("ws://ws.mydomain.com:8080");

newWS.onopen = () => {
console.log("Connected to chat server");
};

newWS.onerror = (err) => console.error(err);

newWS.onclose = () => {
console.log("Disconnected from chat server");
};
const newWS = new WebSocket("ws://ws.mydomain.com:8080");

newWS.onopen = () => {
console.log("Connected to chat server");
};

newWS.onerror = (err) => console.error(err);

newWS.onclose = () => {
console.log("Disconnected from chat server");
};
There is no error message but also no console.log() that a connection has been established. Neither on the client nor on the server.
10 replies