Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have error when i use ssl+pm2 #15

Open
info-infoman opened this issue Apr 25, 2017 · 0 comments
Open

I have error when i use ssl+pm2 #15

info-infoman opened this issue Apr 25, 2017 · 0 comments

Comments

@info-infoman
Copy link

info-infoman commented Apr 25, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant