aryabp
aryabp
RRailway
Created by aryabp on 7/17/2024 in #✋|help
express & socket.io ssl support issue
require('dotenv').config() const express = require('express'); const cors = require('cors'); const http = require('http'); const userRouter = require('./router/router') const socketIo = require('socket.io'); const app = express(); const server = http.createServer(app); const io = socketIo(server, { cors: { origin: '*' } }); app.use(cors()); app.use(express.json()) app.use(express.urlencoded({ extended: false })); app.use('/', userRouter); app.set('trust proxy', true); const port = process.env.PORT || 4000; server.listen(port, () => { console.log(Express server listening on port ${port}); }); when i deploy the code why only wss service that available in railway given url? why https can't be accessed? ( plain http/ws still works)
21 replies