updated proxy.proxy_url -> proxy.url
This commit is contained in:
parent
0e5a24a3f9
commit
9926767a28
4 changed files with 8 additions and 8 deletions
|
@ -196,10 +196,10 @@ schedule:
|
|||
|
||||
## Proxy
|
||||
|
||||
The config can be used to proxy HTTP/HTTPS requests through a proxy:
|
||||
An HTTP/HTTPS proxy can be configured in the config or through the `GOWATCH_PROXY_URL` environment variable:
|
||||
```
|
||||
proxy:
|
||||
proxy_url: http://proxy.com:1234
|
||||
url: http://proxy.com:1234
|
||||
```
|
||||
This will not work for requests made through Lua filters or Browserless but when using the docker image, the `HTTP_PROXY` and `HTTPS_PROXY` environment variables can also be used which will route all traffic through the proxy:
|
||||
```
|
||||
|
|
|
@ -42,7 +42,7 @@ database:
|
|||
schedule: "@every 1d"
|
||||
path: "/backup/{{.Year}}_{{.Month}}_{{.Day}}T{{.Hour}}-{{.Minute}}-{{.Second}}.gzip" # https://pkg.go.dev/time available
|
||||
proxy:
|
||||
proxy_url: http://proxy.com:1234
|
||||
url: http://proxy.com:1234
|
||||
browserless:
|
||||
url: http://your.browserless:1234
|
||||
gin:
|
||||
|
|
|
@ -324,8 +324,8 @@ func getFilterResultURLs(filter *Filter, urlCache map[string]string, debug bool)
|
|||
|
||||
func getURLContent(filter *Filter, fetchURL string) (string, error) {
|
||||
var httpClient *http.Client
|
||||
if viper.IsSet("proxy.proxy_url") {
|
||||
proxyUrl, err := url.Parse(viper.GetString("proxy.proxy_url"))
|
||||
if viper.IsSet("proxy.url") {
|
||||
proxyUrl, err := url.Parse(viper.GetString("proxy.url"))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
@ -104,10 +104,10 @@ func (web *Web) addCronJobIfCronFilter(filter *Filter, startup bool) {
|
|||
web.cronWatch[filter.ID] = entryID
|
||||
}
|
||||
|
||||
// validateProxyURL calls url.Parse with the proxy.proxy_url, if there is an error, it's added to startupWarnings
|
||||
// validateProxyURL calls url.Parse with the proxy.url, if there is an error, it's added to startupWarnings
|
||||
func (web *Web) validateProxyURL() {
|
||||
if viper.IsSet("proxy.proxy_url") {
|
||||
_, err := url.Parse(viper.GetString("proxy.proxy_url"))
|
||||
if viper.IsSet("proxy.url") {
|
||||
_, err := url.Parse(viper.GetString("proxy.url"))
|
||||
if err != nil {
|
||||
web.startupWarning("Could not parse proxy url, check config")
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue