updated proxy.proxy_url -> proxy.url

This commit is contained in:
BroodjeAap 2023-03-04 12:39:29 +00:00
parent 0e5a24a3f9
commit 9926767a28
4 changed files with 8 additions and 8 deletions

View file

@ -196,10 +196,10 @@ schedule:
## Proxy ## 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:
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: 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:
``` ```

View file

@ -42,7 +42,7 @@ database:
schedule: "@every 1d" schedule: "@every 1d"
path: "/backup/{{.Year}}_{{.Month}}_{{.Day}}T{{.Hour}}-{{.Minute}}-{{.Second}}.gzip" # https://pkg.go.dev/time available path: "/backup/{{.Year}}_{{.Month}}_{{.Day}}T{{.Hour}}-{{.Minute}}-{{.Second}}.gzip" # https://pkg.go.dev/time available
proxy: proxy:
proxy_url: http://proxy.com:1234 url: http://proxy.com:1234
browserless: browserless:
url: http://your.browserless:1234 url: http://your.browserless:1234
gin: gin:

View file

@ -324,8 +324,8 @@ func getFilterResultURLs(filter *Filter, urlCache map[string]string, debug bool)
func getURLContent(filter *Filter, fetchURL string) (string, error) { func getURLContent(filter *Filter, fetchURL string) (string, error) {
var httpClient *http.Client var httpClient *http.Client
if viper.IsSet("proxy.proxy_url") { if viper.IsSet("proxy.url") {
proxyUrl, err := url.Parse(viper.GetString("proxy.proxy_url")) proxyUrl, err := url.Parse(viper.GetString("proxy.url"))
if err != nil { if err != nil {
return "", err return "", err
} }

View file

@ -104,10 +104,10 @@ func (web *Web) addCronJobIfCronFilter(filter *Filter, startup bool) {
web.cronWatch[filter.ID] = entryID 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() { func (web *Web) validateProxyURL() {
if viper.IsSet("proxy.proxy_url") { if viper.IsSet("proxy.url") {
_, err := url.Parse(viper.GetString("proxy.proxy_url")) _, err := url.Parse(viper.GetString("proxy.url"))
if err != nil { if err != nil {
web.startupWarning("Could not parse proxy url, check config") web.startupWarning("Could not parse proxy url, check config")
return return