Has anyone successfully made socket.io connection with Frappe and an external (non-frappe)application?
It works fine for me in localhost, but from other domains/systems, it doesn’t work.
Firefox can’t establish a connection to the server at wss://clean-steaks-pull.loca.lt/socket.io/?EIO=4&transport=websocket.
This is unrelated, it’s about realtime (frappe’s implementation of socket.io for internal stuff) not working.
Was a silly mistake, making the server listen to 0.0.0.0 solved it.
If anyone needs the code:
custom_socket.js
const { Server } = require("socket.io");
const http = require("node:http");
const {
get_conf,
get_redis_subscriber,
} = require("../../../frappe/node_utils");
// the path here changes depends on where you place this file in your app
const conf = get_conf();
This file has been truncated. show original
frappe-bench-redis:frappe-bench-redis-cache: stopped
frappe-bench-redis:frappe-bench-redis-queue: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
custom_socketio: ERROR (spawn error)
frappe-bench-redis:frappe-bench-redis-cache: started
frappe-bench-redis:frappe-bench-redis-queue: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
i did try reload but not working for me ? Can anyone help me???