You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import compression from 'compression'
import express from 'express'
import { Server } from 'https'
import fs from 'fs'
//import engineIO from 'engine.io'
import socketIO from 'socket.io'
import routing from './routing'
import { WEB_PORT, STATIC_PATH } from '../shared/config'
import { isProd } from '../shared/util'
import setUpSocket from './socket'
http.listen(WEB_PORT, () => {
// eslint-disable-next-line no-console
console.log(Server running on port ${WEB_PORT} ${isProd ? '(production)' : '(development).\nKeep "yarn dev:wds" running in an other terminal'}.)
})`
and in package.json: "prod:start": "cross-env NODE_ENV=production pm2 start lib/server -i 0 && pm2 logs",
and when i start yarn prod:start
my chrome have error with socket connect (error 400)
and error ssl sert with wss://***** connect
i try use engine.io but i d't know how do it...
pls help - how use engine.io in this project?
sorry for my english
The text was updated successfully, but these errors were encountered:
Hi, i have error in socket.io when i use ssl+pm2
i have change:
in src/server/index.js
`// @flow
import compression from 'compression'
import express from 'express'
import { Server } from 'https'
import fs from 'fs'
//import engineIO from 'engine.io'
import socketIO from 'socket.io'
import routing from './routing'
import { WEB_PORT, STATIC_PATH } from '../shared/config'
import { isProd } from '../shared/util'
import setUpSocket from './socket'
const app = express()
// flow-disable-next-line
var options = {
key: fs.readFileSync('./privkey1.pem'),
cert: fs.readFileSync('./cert1.crt'),
ca: fs.readFileSync('./lec.crt')
};
const http = Server(options, app)
const io = socketIO(http)
//const io = engineIO(http)
setUpSocket(io)
app.use(compression())
app.use(STATIC_PATH, express.static('dist'))
app.use(STATIC_PATH, express.static('public'))
routing(app)
http.listen(WEB_PORT, () => {
// eslint-disable-next-line no-console
console.log(
Server running on port ${WEB_PORT} ${isProd ? '(production)' : '(development).\nKeep "yarn dev:wds" running in an other terminal'}.
)})`
and in package.json:
"prod:start": "cross-env NODE_ENV=production pm2 start lib/server -i 0 && pm2 logs",
and when i start yarn prod:start
my chrome have error with socket connect (error 400)
and error ssl sert with wss://***** connect
i try use engine.io but i d't know how do it...
pls help - how use engine.io in this project?
sorry for my english
The text was updated successfully, but these errors were encountered: