Skip to content

Instantly share code, notes, and snippets.

View shendongming's full-sized avatar
💭
I may be slow to respond.

sdm2345 shendongming

💭
I may be slow to respond.
View GitHub Profile
@shendongming
shendongming / proxy.go
Last active August 29, 2015 14:07 — forked from vmihailenco/proxy.go
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
var fs = require('fs'),
util = require('util'),
Stream = require('stream').Stream;
/**
* Create a bandwidth limited stream
*
* This is a read+writeable stream that can limit how fast it
* is written onto by emitting pause and resume events to
* maintain a specified bandwidth limit, that limit can