Socket
Book a DemoInstallSign in
Socket

mudebug-socket

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mudebug-socket

Simulate network conditions

latest
Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

mudebug-socket

A wrapper of any mudb sockets and socket servers for simulating network conditions.

usage

To simulate network conditions on the client side.

// downstream latency of ~100 ms
new MuDebugSocket({
    socket, // a MuSocket
    inLatency: 100,
})

// downstream jitter up to 30 ms
new MuDebugSocket({
    socket,
    inJitter: 30,
})

// ~1% downstream packet loss
new MuDebugSocket({
    socket,
    inPacketLoss: 1,
})

// upstream latency of ~100 ms
new MuDebugSocket({
    socket,
    outLatency: 100,
})

// upstream jitter up to 30 ms
new MuDebugSocket({
    socket,
    outJitter: 30,
})

// ~1% upstream packet loss
new MuDebugSocket({
    socket,
    outPacketLoss: 1,
})

You can pass in any combinations of the above to simulate the condition that you need. Also, you can simulate the same set of network conditions on the server side.

Unlike in other mudb socket modules, MuDebugSocket and MuDebugServer are designed to be asymmetrical, meaning you don't have to use both at the same time.

table of contents

  • 1 install
  • 2 api
  • 3 TODO

1 install

npm i mudebug-socket

2 api

2.1 class: MuDebugServer

2.1.1 new MuDebugServer(spec)

  • spec:object
    • socketServer:MuSocketServer
    • inLatency?:number
    • inJitter?:number
    • inPacketLoss?:number
    • outLatency?:number
    • outJitter?:number
    • outPacketLoss?:number

2.2 class: MuDebugSocket

2.2.1 new MuDebugSocket(spec)

  • spec:object
    • socket:MuSocket
    • inLatency?:number
    • inJitter?:number
    • inPacketLoss?:number
    • outLatency?:number
    • outJitter?:number
    • outPacketLoss?:number

3 TODO

  • tampered packets
  • low bandwidth
  • slow open
  • out-of-order packets
  • duplicate packets
  • throttling

credits

Copyright (c) 2018 He Diyi, Shenzhen Dianmao Technology Company Limited

Keywords

mudb

FAQs

Package last updated on 02 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts