-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial #1
Conversation
|
||
var AccepTimeout = time.Second | ||
|
||
func init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be moved to an init in the test files themselves, seems a bit out of place to have code here just to make tests easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@graemej please check this out as well. |
} | ||
|
||
func (link *link) pipe(src, dst net.Conn) { | ||
_, err := io.Copy(dst, src) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd log the number of bytes seems like useful debugging info
Kind of disappointed that you choose to create a separate HTTP control backend. I feel like this thing could be vastly simpler if the proxy simply allowed for magic byte prefixed packages at the beginning of a new connection to configure it. EDIT: ah, I guess that would mean you would have to use modified client libraries, which isn't a good idea. |
@tobi that would make the proxy simpler indeed, but wouldn't we pay the price having to hack all the clients on the ruby side? |
@camilo yea I just reasoned this out after sending the comment. This approach here is fine then. I still feel like it could be simpler if it would just read the proxy data from command line and we would simply fork a new toxiproxy in the background whenever needed from the ruby client lib but this is semantics. @sirupsen elegant implementation |
@tobi @camilo Yeah, that's the reason why I ended up with the HTTP interface. It makes clients stupid simple. I like the idea of magic bytes concept, but unfortunately in practise it means patching |
@sirupsen LGTM in general a walk trough tho would be nice. |
@tobi We need both (haven't implemented command-line yet), because I want My goal with |
Yea you are right. I forgot that the connections outlive the unit tests and
On Sun, Sep 7, 2014 at 8:43 PM, Simon Eskildsen notifications@github.com
|
r.HandleFunc("/proxies/{name}", server.ProxyDelete).Methods("DELETE") | ||
http.Handle("/", r) | ||
|
||
err := http.ListenAndServe(":8474", nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick for later: this could be a config options
I'm going to merge this for now and follow up with new PRs. |
Working implementation of
toxiproxy
with no client library. Currently it only supports adding and removing proxies, enough functionality to simulate complete network partitions and service downtime. However, it's built with space in mind to add "toxic" to aProxy
(and thereby all itsLink
s), which is going to be aio.ReadWriteCloser
to allow control over how the bytes are sent in theLink
.A key functionality this will need before hitting development and CI is the ability to "seed" with proxies with command line arguments. I'll get to that in a later PR.
This was the first complete piece I felt I could PR, and it's already a lot to review. I've added some short comments at the top of the key structs, which hopefully makes it easier to understand. I can also walk through it in person.
This should be enough to create a Ruby client library.
@Shopify/resiliency
Review @fw42 @csfrancis since you guys are on Resiliency and have touched Go :)