Skip to content

Running wss in Nextjs #1786

@hypo-thesis

Description

@hypo-thesis

I was unable to find a work around to make my ws into wss on Nextjs. As on Express I can

const server = https.createServer({
  cert: fs.readFileSync('/www/wwwroot/domain/cert/cert.pem'),
  key: fs.readFileSync('/www/wwwroot/domain/cert/key.pem')
});
const wss = new Websocket.Server({ server })
server.listen(8082)

I do not know how to integrate the pem certificates in Nextjs.
ws works fine with nextjs but I am not sure how I can introduce the ssl to work with ws with nextjs.
Can you give me some direction to use wss intead of ws?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions