Martti T
e0f2a02e4c
proxy middleware should use http proxy for SSE requests ( #2624 )
2024-04-15 21:12:26 +03:00
Martti T
3598f295f9
Change type definition blocks to single declarations. This helps copy/pasting Echo code in examples. ( #2606 )
2024-03-09 07:53:07 -08:00
Martti T
a842444e8f
Add SPDX licence comments to files. See https://spdx.dev/learn/handling-license-info/ ( #2604 )
2024-03-09 11:21:24 +02:00
Kai Ratzeburg
c7d6d4373f
proxy middleware: reuse echo request context ( #2537 )
2023-11-05 18:01:01 +02:00
mikemherron
0ae74648b9
Support retries of failed proxy requests ( #2414 )
...
Support retries of failed proxy requests
2023-05-12 20:36:24 +03:00
Becir Basic
5b36ce3612
Fixes the concurrency issue of calling the Next()
proxy target on RRB ( #2409 )
...
* Fixes the concurrency issue of calling the `Next()` proxy target on round robin balancer
- fixed concurrency issue in `AddTarget()`
- moved `rand.New()` to the random balancer initializer func.
- internal code reorganized eliminating unnecessary pointer redirection
- employing `sync.Mutex` instead of `RWMutex` which brings additional overhead of tracking readers and writers. No need for that since the guarded code has no long-running operations, hence no realistic congestion.
- added additional guards without which the code would otherwise panic (e.g., the case where a random value is calculation when targets list is empty)
- added descriptions for func return values, what to expect in which case.
- Improve code test coverage
---------
Co-authored-by: Becir Basic <bb@neotel.at>
2023-02-24 20:32:41 +02:00
Hristo Hristov
0ce73028d0
[suggestion] Add helper interface for ProxyBalancer interface ( #2316 )
...
* [suggestion] Add helper interface for ProxyBalancer interface
* Update proxy_test.go
* addressed code review comments
* address pr comments
* clean up
* return error
2022-10-29 21:54:23 +03:00
Martti T
a4ab482b60
Add Go 1.16 to CI and drop 1.12 specific code ( #1850 )
...
* Correct incorrect years in CHANGELOG.md
* CI tests with last 4 versions. Remove 1.12 and below specific code
* Rename proxy test
2021-04-16 11:38:12 +02:00
Martti T
4c2fd1fb04
Allow proxy middleware to use query part in rewrite ( fix #1798 ) ( #1802 )
2021-03-09 13:22:11 +01:00
Roland Lammel
932976ded6
Support real regex rules for rewrite and proxy middleware ( #1767 )
...
Support real regex rules for rewrite and proxy middleware (use non-greedy matching by default)
Co-authored-by: pwli <lipw0755@gmail.com>
2021-02-08 16:58:55 +02:00
Arun Gopalpuri
f6dfcbe774
bugfix proxy and rewrite, updated test with actual call settings
2020-09-16 19:29:22 -07:00
Arun Gopalpuri
1a6ec73e57
using url.EscapedPath instead of custom GetPath, rewritePath func added to middleware - used by proxy and rewrite
2020-08-31 13:09:24 -07:00
Peter C
6463bcb190
added ModifyResponse option to ProxyConfig ( #1622 )
...
Co-authored-by: Peter C <petoc@users.noreply.github.com>
2020-08-27 17:51:27 -07:00
Arun Gopalpuri
2207c37bf8
use echo.GetPath for rewrite in proxy ( #1548 )
...
Co-authored-by: Arun Gopalpuri <arun@gopalpuri.com>
2020-04-08 08:19:22 -07:00
Shinichi TAMURA
7c5af01350
Safer/trustable extraction of real ip from request ( #1478 )
...
* Safer/trustable extraction of real ip from request
* Fix x-real-ip handling on proxy
* fix docs
* fix default check
2020-02-24 08:29:34 -08:00
Vishal Rana
05262e484a
Capture proxy middleware error
...
Signed-off-by: Vishal Rana <vr@labstack.com>
2019-10-06 16:56:21 -07:00
Hemachandar
775b2eefec
Refactor DefaultProxyConfig Skipper & WebSocket Check in Context ( #1297 )
...
* refactor: default to DefaultProxyConfig.Skipper if not provided
* refactor: use strings library for websocket check
2019-03-02 10:43:23 -08:00
Alex Ungur
6d9e043284
Introduced Go module support as v4, removed obsolete CloseNotifier() mechanism
...
This reintroduces support for Go modules, as v4.
CloseNotifier() is removed as it has been obsoleted, see https://golang.org/doc/go1.11#net/http
It was already NOT working (not sending signals) as of 1.11 the functionality was gone, we merely
deleted the functions that exposed it. If anyone still relies on it they should migrate to using
`c.Request().Context().Done()` instead.
Closes #1268 , #1255
2019-01-30 16:11:42 +02:00
Gregor Noczinski
bc37a3a792
Proxy: Better errors + remote custom TLS ( #1197 )
...
Proxy will be more verbose on errors + possibility to configure custom transport (example: for custom TLS certificates)
2018-10-13 11:40:19 +05:30
Artyom Turkin
fcdf096c2c
extend proxy middleware. closes #1202 ( #1203 )
...
* extend proxy middleware. closes #1202
2018-10-09 09:13:39 +05:30
Evgeniy Kulikov
f49d166e6f
[FIX] Cleanup code ( #1061 )
...
Code cleanup
2018-02-21 10:44:17 -08:00
Vishal Rana
9ae7047759
Rewrite rules for proxy middleware
...
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-12-27 15:14:44 -08:00
Vishal Rana
62f95acdd7
Dynamically add/remove proxy targets
...
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-12-25 14:39:37 -08:00
Amr Tamimi
7d67651a3b
check proxy skipper before proceeding ( #992 )
2017-08-19 18:42:58 -07:00
Vishal Rana
2d7cce4677
Updated godoc
...
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-06-15 08:44:21 -07:00
Vishal Rana
e1e3ebe5a1
Proxy middleware refactor
...
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-06-15 08:19:18 -07:00
Vishal Rana
3673d7fb44
Enhanced proxy middleware
...
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-06-06 15:01:13 -07:00
Vishal Rana
c3887ebb13
Added Context#IsWebSocket(), proxy fix header
...
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-06-04 10:39:08 -07:00
Vishal Rana
68b89eca6c
Updated godco for middleware/proxy
...
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-06-03 21:23:15 -07:00
Vishal Rana
0898d9e68b
Exposed proxy balancer interface
...
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-06-03 17:37:35 -07:00
Vishal Rana
a8cd0ad133
Closes #942
...
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-06-02 18:13:26 -07:00