1
0
mirror of https://github.com/umputun/reproxy.git synced 2024-11-30 08:16:56 +02:00
Commit Graph

66 Commits

Author SHA1 Message Date
Umputun
fa23778d42 make LBSelector interface and implement all the current methods plus roundrobin 2023-11-27 12:08:28 -06:00
Umputun
a896f08eec add middleware to optionally allow requests from giving ips/ranges
add new remote param to docker and file providers

lint: http nil body

add support of remote ips to consul provider

local implementation of onlyfrom middleware

lint: missing comment

make proxy tests more readable

preffer public IP if any forwwarded
2023-11-26 16:17:04 -06:00
Umputun
197246a05a drop legacy rand.Seed 2023-02-27 14:51:25 -06:00
ravilushqa
546c2609b0 defer recover 2022-08-21 03:48:44 -05:00
Vadim YR
b9e994be0c type in return error 2022-06-23 22:57:35 -05:00
Umputun
b4225a4a4d fix error message 2022-02-15 03:00:34 -06:00
Negasus
4126fa7993 update error message 2022-02-15 02:59:44 -06:00
Negasus
22bea287e4 return error on wrong ssl.type value 2022-02-15 02:59:44 -06:00
Umputun
64f57df860 add support of custom 404 page for assets server 2022-01-06 00:16:18 -06:00
Umputun
075f66825a update linter and address all lint warns 2021-11-09 12:47:41 -06:00
Umputun
8c59be3612 implement simple on/off basic-auth for all resources
lint: err shadowing

extract htpasswd file load and add tests
2021-11-09 12:47:41 -06:00
Umputun
76fa56777f add ability to drop incoming headers #108
In some cases proxy should sanitize incoming headers. --drop-header and $DROP_HEADERS set list of headers (keys) and those headers removed from the request.
2021-09-11 14:38:56 -05:00
Umputun
803a076b79 fix incorrect detection of header's dbl quotes 2021-07-09 15:20:45 -05:00
Umputun
cd41237fa5 lint: simplify empty string check 2021-07-08 16:40:14 -05:00
Umputun
cbe7f6f84d drop leading and trailing dbl-quotes from the headers #100 2021-07-08 16:27:42 -05:00
Umputun
207a467960
Header comma (#101)
* allow comma inside of header env list #100

* set proxy header to manually split version
2021-07-08 02:31:27 -05:00
Umputun
71039681e2
Merge pull request #97
* revendor with latest rest lib

* simplify with passThroughHandler

* add deps for throttling
2021-07-03 01:23:50 -05:00
Umputun
e44ca79f23 add support of spa to common assets 2021-06-07 19:16:18 -05:00
Umputun
7139c57766
RPC plugins support (#85)
* wip

* resolve merge artifacts

* full coverage for conductor

* wire plugin conductor to main and proxy

* wip, with separate match handler

* split matching logic with another handler, add initial docs

* move parts of proxy to handlers, add tests

* add headers in to be sent to proxied url

* merged from master

* add example with docker compose

* supress excesive debug reporting 0-9 disabled in docker

* add plugin tests

* randomize test port

* lint: minor warns

* lint: err shadow
2021-06-01 02:56:39 -05:00
Umputun
282b4b268c add lb selector 2021-05-28 16:11:16 -05:00
Umputun
971e77b5d3 eliminate metrics middleware hit if mgmt disabled 2021-05-22 10:44:21 -05:00
Umputun
0c1218b3eb strip fqdn spaces 2021-05-19 13:39:49 -05:00
Umputun
095f4d7102
Multi match (#74)
* discovery support for multiple matches

* switch proxy matcher usage, add random selection

* fix multi-match logic

* pass match picker func

* simplify rand picker

* update health params and docs

* fix early termination on discovery multi-match

* add grouping of sorted matches in sorted result

* add mention of live check to readme
2021-05-16 18:34:51 -05:00
nikolay.bystritskiy
973d6c9a14 add automatic health-checker 2021-05-16 14:17:50 -05:00
Umputun
3dd986ba16 lint: silly thing 2021-05-14 22:03:16 -05:00
Umputun
b79a9faf3c support size units #71 2021-05-14 22:01:27 -05:00
Negasus
738c3baf6c add consul catalog provider 2021-05-13 01:14:04 -05:00
Umputun
5c1ab356cc fix default ssk port selection 2021-05-03 21:52:08 -05:00
Umputun
4c051ca37f
detect in-container and set listen address to 0.0.0.0 (#62)
* detect in-container and set listen to 0.0.0.0

* simplify default address logic

don't change if user defined, use 127.0.0.1:8080 for non-docker and 0.0.0.0:8080 for in-docker only if nothing set

* add dynamic default to redir http port

* add docs about dynamic defaults

* add ssl example

* lint: params warn
2021-05-03 21:40:21 -05:00
Umputun
5743109210
Nice error (#61)
* add support of html error reporting with custom templates

* typo

* formatting

* better template load error msg
2021-04-30 04:03:36 -05:00
Umputun
2670144e8a add support of docker route prefix 2021-04-28 14:00:38 -05:00
Umputun
a4cffbe922
Mime cache (#59)
* support different caching duration for different mime types #58

* extract main code to run func

* lint: err shadowing
2021-04-26 18:51:48 -05:00
Umputun
c590c3246d
Assets cache (#54)
* add caching control for assets
* regen site
2021-04-23 02:02:36 -05:00
Umputun
8ea0052228 implement basic support of metrics via mgmt server #35 2021-04-20 19:22:46 -05:00
Umputun
3499836b90 fix typo in help msg 2021-04-19 03:25:59 -05:00
Timofey
7f991b1e18 Refactor
Thx for the feedback.

* Add missing test
* Decouple containerInfo from docker client
* Move refresh interval var to `Docker`
* Minor things
2021-04-16 17:30:54 -05:00
Timofey
a91fb6816f Invoke Docker API directly
* Remove third-party docker client dependency
* Simplify code and tests

Might need to run `go mod tidy` and `go mod vendor` afterwards
2021-04-16 17:30:54 -05:00
Umputun
8cf4b9063d
Multiple static location (#36)
* add isStatic flag to mapper, implement for file and static providers

* handle static match response as a special case

* move assets conversion to load time

* rename static to assets everywhere for consistency

* don't overwride asset param in url mapper

* add documentation about assets mode

* add tests
2021-04-16 02:49:00 -05:00
Vladimir Garvardt
66610ef491 Replaced github.com/pkg/errors with stdlib errors wrap 2021-04-14 11:44:20 -05:00
Umputun
6dcc2fa719 flip signature, disabled by default 2021-04-13 14:08:15 -05:00
Umputun
d8309ab6f2 allow optional stdout logging 2021-04-13 12:45:49 -05:00
Umputun
64fd98a130 all timeouts are customizable #5 2021-04-12 21:54:59 -05:00
Umputun
a20abd0140 change docker default and add autoapi param #20 2021-04-12 02:57:13 -05:00
Umputun
1ac2f23504 adjust tests for delayed events 2021-04-12 02:29:17 -05:00
Umputun
a79cd3c7a4 correct providers order 2021-04-12 02:07:35 -05:00
Umputun
5a98338f84 fix separator conflict between env and static rule parts 2021-04-11 23:18:06 -05:00
Umputun
46d83f235e don't run discovery if no providers 2021-04-11 14:21:58 -05:00
Umputun
be20b0b636 allow use of assets server without any provider 2021-04-10 14:34:28 -05:00
Umputun
b0dcad19fc disable network check by default 2021-04-10 02:08:26 -05:00
Umputun
6508c95eae update deps 2021-04-09 15:31:14 -05:00