Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 432 Bytes

server_adapter_value.md

File metadata and controls

14 lines (10 loc) · 432 Bytes

server.adapath([value])

  • value(Adapter)
  • Returns Server|Adapter

设置适配器。默认为socket.io随附的基于内存的Adapter实例。见socket.io-adapter 。如果没有提供参数,此方法将返回当前值。

const io= require('socket.io')(3000);
const redis= require('socket.io-redis');

io.adapter(redis({host:"localhost",port:6379}));