From 1dc38220a7d8da3f82c0f7e05d7cb510aa9e85e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:12:46 +0000 Subject: [PATCH] build(deps): bump github.com/elazarl/goproxy from 1.2.1 to 1.2.2 Bumps [github.com/elazarl/goproxy](https://github.com/elazarl/goproxy) from 1.2.1 to 1.2.2. - [Release notes](https://github.com/elazarl/goproxy/releases) - [Commits](https://github.com/elazarl/goproxy/compare/v1.2.1...v1.2.2) --- updated-dependencies: - dependency-name: github.com/elazarl/goproxy dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +-- vendor/github.com/elazarl/goproxy/README.md | 29 +++++++++++++++++++ .../github.com/elazarl/goproxy/websocket.go | 19 ++++++++++-- vendor/modules.txt | 2 +- 5 files changed, 50 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 1ed9faaa00..4c20987437 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/cucumber/godog v0.15.0 github.com/cucumber/messages-go/v10 v10.0.3 github.com/docker/go-units v0.5.0 - github.com/elazarl/goproxy v1.2.1 + github.com/elazarl/goproxy v1.2.2 github.com/gorilla/handlers v1.5.2 github.com/h2non/filetype v1.1.3 github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb diff --git a/go.sum b/go.sum index 4a08463992..9cb65ada56 100644 --- a/go.sum +++ b/go.sum @@ -103,8 +103,8 @@ github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQ github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/elazarl/goproxy v1.2.1 h1:njjgvO6cRG9rIqN2ebkqy6cQz2Njkx7Fsfv/zIZqgug= -github.com/elazarl/goproxy v1.2.1/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64= +github.com/elazarl/goproxy v1.2.2 h1:gBQSetgBgnAW4DTeymUR/zKvXOAf24uH3+V3bilhJ3M= +github.com/elazarl/goproxy v1.2.2/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= diff --git a/vendor/github.com/elazarl/goproxy/README.md b/vendor/github.com/elazarl/goproxy/README.md index 89900b965d..405ada6421 100644 --- a/vendor/github.com/elazarl/goproxy/README.md +++ b/vendor/github.com/elazarl/goproxy/README.md @@ -53,6 +53,23 @@ we won't merge it... `:D` The code for this project is released under the `BSD 3-Clause` license, making it useful for `commercial` uses as well. +### Submit your case study +So, you have introduced & integrated GoProxy into one of your personal projects +or a project inside the company you work for. + +We're happy to learn about new `creative solutions` made with this library, +so feel free to `contact` the maintainer listed above via e-mail, to explaining +why you found this project useful for your needs. + +If you have signed a `Non Disclosure Agreement` with the company, you +can propose them to write a `blog post` on their official website about +this topic, so this information will be public by their choice, and you can +`share the link` of the blog post with us :) + +The purpose of case studies is to share with the `community` why all the +`contributors` to this project are `improving` the world with their help and +what people are building using it. + ### Linter The codebase uses an automatic lint check over your Pull Request code. Before opening it, you should check if your changes respect it, by running @@ -70,6 +87,18 @@ aren't sure about it). Make sure to include the bin folder in the path of your shell, to be able to directly use the `golangci-lint run` command. +## Versioning +With GitHub, there are 2 version types: release versions (such as `v1.x`) +and Go branch default versions (such as `v0.0.0-202412xxx`). +The latter is `automatically` assigned by Go modules command if the +master branch contains new commits that aren't present in the last +GitHub release. + +We plan to `periodically` publish stable releases (v1.x), after a while that +no one reports issues with the fixes merged in the master branch. +You can `safely use both` version types, since we carefully review +all the pull requests before merging them. + ## A taste of GoProxy To get a taste of `goproxy`, here you are a basic HTTP/HTTPS proxy diff --git a/vendor/github.com/elazarl/goproxy/websocket.go b/vendor/github.com/elazarl/goproxy/websocket.go index 07c73a3bae..97108ee507 100644 --- a/vendor/github.com/elazarl/goproxy/websocket.go +++ b/vendor/github.com/elazarl/goproxy/websocket.go @@ -4,6 +4,7 @@ import ( "bufio" "crypto/tls" "io" + "net" "net/http" "net/url" "strings" @@ -32,7 +33,14 @@ func (proxy *ProxyHttpServer) serveWebsocketTLS( tlsConfig *tls.Config, clientConn *tls.Conn, ) { - targetURL := url.URL{Scheme: "wss", Host: req.URL.Host, Path: req.URL.Path} + host := req.URL.Host + // Port is optional in req.URL.Host, in this case SplitHostPort returns + // an error, and we add the default port + _, port, err := net.SplitHostPort(req.URL.Host) + if err != nil || port == "" { + host = net.JoinHostPort(req.URL.Host, "443") + } + targetURL := url.URL{Scheme: "wss", Host: host, Path: req.URL.Path} // Connect to upstream targetConn, err := tls.Dial("tcp", targetURL.Host, tlsConfig) @@ -58,7 +66,14 @@ func (proxy *ProxyHttpServer) serveWebsocketHttpOverTLS( req *http.Request, clientConn *tls.Conn, ) { - targetURL := url.URL{Scheme: "ws", Host: req.URL.Host, Path: req.URL.Path} + host := req.URL.Host + // Port is optional in req.URL.Host, in this case SplitHostPort returns + // an error, and we add the default port + _, port, err := net.SplitHostPort(req.URL.Host) + if err != nil || port == "" { + host = net.JoinHostPort(req.URL.Host, "80") + } + targetURL := url.URL{Scheme: "ws", Host: host, Path: req.URL.Path} // Connect to upstream targetConn, err := proxy.connectDial(ctx, "tcp", targetURL.Host) diff --git a/vendor/modules.txt b/vendor/modules.txt index 5748df3492..9ee1b92706 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -278,7 +278,7 @@ github.com/docker/go-connections/tlsconfig # github.com/docker/go-units v0.5.0 ## explicit github.com/docker/go-units -# github.com/elazarl/goproxy v1.2.1 +# github.com/elazarl/goproxy v1.2.2 ## explicit; go 1.20 github.com/elazarl/goproxy github.com/elazarl/goproxy/internal/signer