mudebug-socket
A wrapper of any mudb sockets and socket servers for simulating network conditions.
usage
To simulate network conditions on the client side.
new MuDebugSocket({
socket,
inLatency: 100,
})
new MuDebugSocket({
socket,
inJitter: 30,
})
new MuDebugSocket({
socket,
inPacketLoss: 1,
})
new MuDebugSocket({
socket,
outLatency: 100,
})
new MuDebugSocket({
socket,
outJitter: 30,
})
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
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