1.1.1 • Published 3 years ago

socket.io-cookies-parser v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Socket.IO Cookies Parser Build Status

Socket.IO Cookies Parser help us handle cookie for Socket.IO

Note: After setup success, socket.request.cookies was parsed to JSON object.

Functions:

/**
 * @method namespaceCookieParser setup socket midleware for namespace instance
 * @param socket Socket
 */
function namespaceCookieParser(socket: Socket): void;
/**
 * @method ioCookieParser setup socket midleware for io instance
 * @param socket Socket
 * @param next (err?: ExtendedError | undefined) => void
 */
function ioCookieParser(socket: Socket, next: (err?: ExtendedError | undefined) => void): void;

Example:

//ES6
import socketio from "socket.io";
import { namespaceCookieParser, ioCookieParser } from "socket.io-cookies-parser";
...
const io = new socketio.Server();
io.use(ioCookieParser);
...
const client = io.of("/client", namespaceCookieParser);
...
1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago