1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-22 20:06:21 +02:00
Commit Graph

29 Commits

Author SHA1 Message Date
Martti T
a842444e8f
Add SPDX licence comments to files. See https://spdx.dev/learn/handling-license-info/ () 2024-03-09 11:21:24 +02:00
Kai Ratzeburg
c7d6d4373f
proxy middleware: reuse echo request context () 2023-11-05 18:01:01 +02:00
eiei114
3950c444b7
fix some typos () 2023-09-13 22:41:58 +03:00
mikemherron
0ae74648b9
Support retries of failed proxy requests ()
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 ()
* 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
toimtoimtoim
a0c211542c Add staticcheck to CI flow 2022-11-21 16:26:13 +02:00
zeek
3c4d3b3083 Replace "io/ioutil"
"io/ioutil" pakcage has been deprecated since Go 1.16.
2022-11-21 15:59:14 +02:00
Hristo Hristov
0ce73028d0
[suggestion] Add helper interface for ProxyBalancer interface ()
* [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 ()
* 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 ) () 2021-03-09 13:22:11 +01:00
Martti T
5622ecc180
Fix performance regression caused by path escaping (, , )
* Fix performance regression  and avoid double escaping in rewrite/proxy middleware.
* Add rewrite test for correct escaping of replacement ()

Co-authored-by: Roland Lammel <rl@neotel.at>
2021-03-08 02:01:02 +01:00
Leo Takaoka
d9e235416d
apply go fmt () 2021-02-26 23:55:00 +02:00
Roland Lammel
932976ded6
Support real regex rules for rewrite and proxy middleware ()
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 ()
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 ()
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 ()
* 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
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 , 
2019-01-30 16:11:42 +02:00
Emir Ribić
c8fd197fa8 Replace http constants with stdlib ones, i.e.: http.MethodGet instead of echo.GET () 2018-10-14 20:46:58 +05:30
Gregor Noczinski
bc37a3a792 Proxy: Better errors + remote custom TLS ()
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 ()
* extend proxy middleware. closes 
2018-10-09 09:13:39 +05:30
Evgeniy Kulikov
f49d166e6f [FIX] Cleanup code ()
Code cleanup
2018-02-21 10:44:17 -08:00
Vishal Rana
da083ffd0a Implemented rewrite middleware
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-12-28 11:26:50 -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
Vishal Rana
e1e3ebe5a1 Proxy middleware refactor
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-06-15 08:19:18 -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
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-06-02 18:13:26 -07:00