diff --git a/.github/goreleaser.yml b/.github/goreleaser.yml index ccb19c5..637c592 100644 --- a/.github/goreleaser.yml +++ b/.github/goreleaser.yml @@ -1,3 +1,6 @@ +# test this goreleaser config with: +# - cd chisel/ +# - goreleaser --skip-publish --rm-dist --config .github/goreleaser.yml builds: - env: - CGO_ENABLED=0 @@ -26,6 +29,9 @@ builds: goarm: - 6 - 7 + gomips: + - hardfloat + - softfloat archives: - format: gz files: diff --git a/LICENSE b/LICENSE index c81ec9a..7ae236f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Jaime Pillora +Copyright (c) 2020 Jaime Pillora Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 17b7e53..4020874 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,11 @@ Chisel is a fast TCP tunnel, transported over HTTP, secured via SSH. Single exec - [Authenticated connections](#authentication); authenticated client connections with a users config file, authenticated server connections with fingerprint matching. - Client auto-reconnects with [exponential backoff](https://github.com/jpillora/backoff) - Client can create multiple tunnel endpoints over one TCP connection -- Client can optionally pass through HTTP CONNECT proxies +- Client can optionally pass through SOCKS or HTTP CONNECT proxies +- Reverse port forwarding (Connections go through the server and out the client) - Server optionally doubles as a [reverse proxy](http://golang.org/pkg/net/http/httputil/#NewSingleHostReverseProxy) - Server optionally allows [SOCKS5](https://en.wikipedia.org/wiki/SOCKS) connections (See [guide below](#socks5-guide)) -- Reverse port forwarding (Connections go through the server and out the client) +- Client optionally allows [SOCKS5](https://en.wikipedia.org/wiki/SOCKS) connections from a reversed port forward ### Install @@ -134,12 +135,11 @@ $ chisel server --help a SIGHUP to short-circuit the client reconnect timer Version: - X.Y.Z + 0.0.0-src (go1.14) Read more: https://github.com/jpillora/chisel - ``` ``` @@ -176,6 +176,8 @@ $ chisel client --help socks 5000:socks R:2222:localhost:22 + R:socks + R:5000:socks When the chisel server has --socks5 enabled, remotes can specify "socks" in place of remote-host and remote-port. @@ -187,6 +189,9 @@ $ chisel client --help be prefixed with R to denote that they are reversed. That is, the server will listen and accept connections, and they will be proxied through the client which specified the remote. + Reverse remotes specifying "R:socks" will listen on the server's + default socks port (1080) and terminate the connection at the + client's internal SOCKS5 proxy. Options: @@ -219,10 +224,10 @@ $ chisel client --help or: socks://admin:password@my-server.com:1080 --header, Set a custom header in the form "HeaderName: HeaderContent". - Can be used multiple times. (e.g --header "Foo: Bar" --header "Hello: World") + Can be used multiple times. (e.g --header "Foo: Bar" --header "Hello: World") --hostname, Optionally set the 'Host' header (defaults to the host - defined in the endpoint url). + found in the server url). --pid Generate pid file in current working directory @@ -236,12 +241,11 @@ $ chisel client --help a SIGHUP to short-circuit the client reconnect timer Version: - X.Y.Z + 0.0.0-src (go1.14) Read more: https://github.com/jpillora/chisel - ``` ### Security @@ -375,26 +379,3 @@ See more [test/](test/) - Better, faster tests - Expose a stats page for proxy throughput - Treat client stdin/stdout as a socket - -#### MIT License - -Copyright © 2017 Jaime Pillora <dev@jpillora.com> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/client/client.go b/client/client.go index 9101abd..d4e52b1 100644 --- a/client/client.go +++ b/client/client.go @@ -221,7 +221,7 @@ func (c *Client) connectionLoop() { c.proxyURL.Scheme) break } - var auth *proxy.Auth = nil + var auth *proxy.Auth if c.proxyURL.User != nil { pass, _ := c.proxyURL.User.Password() auth = &proxy.Auth{