Skip to content

socketio/socket.io-json-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

socket.io-json-parser

An alternative to the default socket.io-parser, encoding and decoding packets with JSON.parse / stringify.

With that parser, binary data (ArrayBuffer / Buffer / Blob / File) is not supported.

Usage

const io = require('socket.io');
const ioc = require('socket.io-client');
const customParser = require('socket.io-json-parser');

let server = io(PORT, {
  parser: customParser
});

let client = ioc('ws://localhost:' + PORT, {
  parser: customParser
});

client.on('connect', () => {
  client.emit('hello');
});

About

socket.io parser based on JSON.stringify / JSON.parse

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy