{"action":"created","issue":{"url":"https://api.github.com/repos/flynn/flynn/issues/842","labels_url":"https://api.github.com/repos/flynn/flynn/issues/842/labels{/name}","comments_url":"https://api.github.com/repos/flynn/flynn/issues/842/comments","events_url":"https://api.github.com/repos/flynn/flynn/issues/842/events","html_url":"https://github.com/flynn/flynn/pull/842","id":55561762,"number":842,"title":"router: add proxy package","user":{"login":"benburkert","id":77,"avatar_url":"https://avatars.githubusercontent.com/u/77?v=3","gravatar_id":"","url":"https://api.github.com/users/benburkert","html_url":"https://github.com/benburkert","followers_url":"https://api.github.com/users/benburkert/followers","following_url":"https://api.github.com/users/benburkert/following{/other_user}","gists_url":"https://api.github.com/users/benburkert/gists{/gist_id}","starred_url":"https://api.github.com/users/benburkert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benburkert/subscriptions","organizations_url":"https://api.github.com/users/benburkert/orgs","repos_url":"https://api.github.com/users/benburkert/repos","events_url":"https://api.github.com/users/benburkert/events{/privacy}","received_events_url":"https://api.github.com/users/benburkert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-27T01:07:53Z","updated_at":"2015-01-29T18:30:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/flynn/flynn/pulls/842","html_url":"https://github.com/flynn/flynn/pull/842","diff_url":"https://github.com/flynn/flynn/pull/842.diff","patch_url":"https://github.com/flynn/flynn/pull/842.patch"},"body":"The `router/proxy` package contains the (reverse)proxy functionality extracted from `router/http.go` & `router/tcp.go`. The package is broken up into two main types: `ReverseProxy` & `transporter`. They are broken up this way to keep features (like sticky-sessions) orthogonal to protocols (like HTTP & TCP) and out of `ReverseProxy`.\r\n\r\nThe `ReverseProxy` is a modified version of `httputil.ReverseProxy` from stdlib. There are a few changes to how it behaves internally that differ from the stdlib implementation. Additionally, support for generic TCP proxying has also been added via `ServeConn`. `ReverseProxy` is able to handle HTTP upgrades internally by using the same dialing logic as `ServeConn`. `transport` is based off `http.Transport` and implements the `http.RoundTripper` interface, but is also modified to support raw `net.Conn` connections via `Connect` and HTTP upgrades via `UpgradeHTTP`.\r\n\r\n#### TODO\r\n\r\n- [x] godoc all exported types & funcs.\r\n- [x] rewrite tests to not use `StickyCookie`, then stop exporting it.\r\n- [x] fix backend list fetching/updating mechanism in `ReverseProxy`.\r\n- [ ] cleanup, squash & reorder commits.\r\n\r\n#### For Later PRs\r\n\r\n- move `router/*_test.go` tests that assert internal proxy behavior into the `router/proxy` package.\r\n- toggle stickiness on existing services.\r\n- context & request logging.\r\n- request/response timeouts.\r\n\r\n/cc @bgentry"},"comment":{"url":"https://api.github.com/repos/flynn/flynn/issues/comments/72077734","html_url":"https://github.com/flynn/flynn/pull/842#issuecomment-72077734","issue_url":"https://api.github.com/repos/flynn/flynn/issues/842","id":72077734,"user":{"login":"titanous","id":13026,"avatar_url":"https://avatars.githubusercontent.com/u/13026?v=3","gravatar_id":"","url":"https://api.github.com/users/titanous","html_url":"https://github.com/titanous","followers_url":"https://api.github.com/users/titanous/followers","following_url":"https://api.github.com/users/titanous/following{/other_user}","gists_url":"https://api.github.com/users/titanous/gists{/gist_id}","starred_url":"https://api.github.com/users/titanous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/titanous/subscriptions","organizations_url":"https://api.github.com/users/titanous/orgs","repos_url":"https://api.github.com/users/titanous/repos","events_url":"https://api.github.com/users/titanous/events{/privacy}","received_events_url":"https://api.github.com/users/titanous/received_events","type":"User","site_admin":false},"created_at":"2015-01-29T18:30:45Z","updated_at":"2015-01-29T18:30:45Z","body":"@bgentry GitHub issues are fine."}}