Skip to content

A TCP proxy that allows you to drop connections at will. Useful for testing network libraries.

License

Notifications You must be signed in to change notification settings

hamiltop/flaky_connection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlakyConnection

When writing a library such as a database driver, dealing with network failures is an absolute requirement. Writing automated tests for such situations becomes tricky. Enter FlakyConnection.

Usage

conn = FlakyConnection.start('localhost', 1234)

# Connect to localhost and the new port
DatabaseFoo.connect('localhost', conn.port)

# Call FlakyConnection.stop(conn) whenever you want to force a disconnect
FlakyConnection.stop(conn)

# Call FlakyConnection.set_latency(conn, 1000) to add latency to each 
# transmission

Roadmap

There are probably a bunch of other ways to emulate a bad network. Partial transmissions interrupted by disconnect or latency might be interesting.

About

A TCP proxy that allows you to drop connections at will. Useful for testing network libraries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages