Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 506 Bytes

new_server_options.md

File metadata and controls

31 lines (23 loc) · 506 Bytes

new Server(options)

  • options (object)

请参阅上面的可用选项列表。

const io = require('socket.io')({
    path:'/test',
    serverClient:false
})

// 或者
const server= require('http').createServer();

io.attach(server,{
    pingInterval:10000,
    pingTimeout:5000,
    cookie:false
})

server.listen(3000);

// 或者
io.attach(3000,{
        pingInterval:10000,
    pingTimeout:5000,
    cookie:false
})