Created
September 22, 2017 11:04
-
-
Save marten-seemann/629255dea89f99d1f64c0ee17f7340d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"math/rand" | |
"time" | |
proxy "github.com/lucas-clemente/quic-go/integrationtests/tools/proxy" | |
"github.com/lucas-clemente/quic-go/internal/protocol" | |
) | |
func main() { | |
rand.Seed(time.Now().UnixNano()) | |
_, err := proxy.NewQuicProxy("localhost:10001", protocol.Version39, &proxy.Opts{ | |
RemoteAddr: "localhost:6121", | |
DelayPacket: func(_ proxy.Direction, _ uint64) time.Duration { | |
return 10 * time.Millisecond | |
}, | |
DropPacket: func(d proxy.Direction, p uint64) bool { | |
return rand.Int63()%100 == 0 | |
}, | |
}) | |
if err != nil { | |
panic(err) | |
} | |
select {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment