B
B
Banan442020-05-13 17:12:59
Node.js
Banan44, 2020-05-13 17:12:59

What's wrong with socket.io?

const express = require('express')
const app = express()
const io = require('socket.io')(3000)

app.get('/', (request, response) => {
  response.sendFile(__dirname + '/index.html')
})

io.on('connection', socket => {
  console.log('A user connected!')

  socket.on('disconnect', () => {
    console.log('A user disconnected!')
  })
})

app.listen(3000, () => {
  console.log('Сервер запущен на порте: 3000')
})
// Error: listen EADDRINUSE: address already in use :::3000

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrew, 2020-05-13
@Banan44

Port 3000 is already busy. Use another.

A
Alexander, 2020-05-13
@Seasle

Read here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question