-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
HTTP CONNECT Tunneling #1003
HTTP CONNECT Tunneling #1003
Conversation
f83f100
to
008b849
Compare
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.
have a couple of comments, but generally looks OK
docs/2.0/admin-guide.md
Outdated
audited and access control rules applied. For these scenarios Teleport supports | ||
HTTP CONNECT tunneling. | ||
|
||
To use HTTP CONNECT tunneling, simply set either the `https_proxy` or |
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.
are those standard names for env variables? generally linux env vars are using HTTPS_PROXY
upper case notations, what are others are using?
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.
Yeah, I was confused by that as well, it looks like Go assumes either all caps or all lower case. From the docs:
ProxyFromEnvironment returns the URL of the proxy to use for a given
request, as indicated by the environment variables HTTP_PROXY, HTTPS_PROXY
and NO_PROXY (or the lowercase versions thereof). HTTPS_PROXY takes
precedence over HTTP_PROXY for https requests.
In code: https://github.com/golang/go/blob/master/src/net/http/transport.go#L550-L560
I'll adjust this.
lib/utils/proxy/proxy.go
Outdated
// build a proxy connection first | ||
pconn, err := dialProxy(d.proxyHost, addr) | ||
if err != nil { | ||
return nil, err |
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.
trace.Wrap
lib/utils/proxy/proxy.go
Outdated
Host: addr, | ||
Header: make(http.Header), | ||
} | ||
connectReq.Write(conn) |
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.
check for error here?
lib/utils/proxy/proxy.go
Outdated
var d net.Dialer | ||
conn, err := d.DialContext(ctx, "tcp", proxyAddr) | ||
if err != nil { | ||
return nil, trace.Wrap(err) |
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.
trace.ConvertSystemError instead
f74bfd3
to
dbacf17
Compare
dbacf17
to
2117306
Compare
* `SharedDirectoryInfoResponse` (#996) * `SharedDirectoryListRequest` (#999) * `SharedDirectoryListResponse` (#1000) * `SharedDirectoryReadRequest` (#1003) * `SharedDirectoryReadResponse` (#1005) * `SharedDirectoryWriteRequest` (#1007) * `SharedDirectoryWriteResponse` (#1008) * Tidy up `sharedDirectoryManager` (#1010) * `SharedDirectoryMoveRequest` (#1045) * `SharedDirectoryMoveResponse` (#1074) * `SharedDirectoryCreateRequest` and `SharedDirectoryCreateResponse` (#1090) * SharedDirectoryDeleteRequest and SharedDirectoryDeleteResponse (#1096) * Add warning dialog for unsupported browsers for directory sharing (#1110) * updates yarn.lock
Purpose
As covered in #860, at the moment Teleport does not support HTTP CONNECT tunneling. This PR adds support for HTTP CONNECT tunneling for Trusted Clusters.
Implementation
proxy
has been added underutils
.proxy
package exposes a single functionDialerFromEnvironment
.DialerFromEnvironment
checks ifhttps_proxy
orhttp_proxy
are set, if either are it dials to the proxy and then establishes a SSH connection, or directly establishes a SSH connection.ssh.Dial
directly we extract a dial from the environment and then establish the reverse tunnel.Related Issues
Fixes #860