I’m struggling to connect to a y-webrtc
server that I’ve hosted on GCP’s app engine. It’s just a fork of the y-webrtc
repo that I’ve deployed to app engine, specifying a node16js
runtime. The server is live and can be reached at
https://strive-editor-379413.as.r.appspot.com
I’m using the WebRTC provider from y-webrtc
to attempt to connect to it, but cannot. I’m trying both wss://
and ws://
protocols but neither are working. My code essentially looks as follows
import { WebrtcProvider } from "y-webrtc";
import * as awarenessProtocol from "y-protocols/awareness";
const provider = new WebrtcProvider(liveId, yDoc, {
signaling: [
"wss://strive-editor-379413.as.r.appspot.com",
"ws://strive-editor-379413.as.r.appspot.com",
"ws://localhost:4444",
],
password: null,
awareness: new awarenessProtocol.Awareness(yDoc),
maxConns: 20 + Math.floor(random.rand() * 15),
filterBcConns: true,
peerOpts: {},
});
console.log("SIGNALLING:", provider.signalingConns);
If I run this locally while I have a local signalling server running, I get the following console log:
I’m able to connect to the localhost server, but not to the live one. Further, I get these error messages in the console:
websocket.js?3d02:25 WebSocket connection to 'ws://strive-editor-379413.as.r.appspot.com/' failed:
websocket.js?3d02:25 WebSocket connection to 'wss://strive-editor-379413.as.r.appspot.com/' failed:
I can also reproduce this in a staging server.
I’m not sure what I’m missing here? Is there a config option on GCP app engine that I need to enable (I can’t seem to find any docs on this)? Is there something in my environment that’s misisng?
Any help here would be greatly appreciated