mirror of
https://github.com/anotherhadi/spilltea.git
synced 2026-05-20 01:32:33 +02:00
upstream proxy
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -18,11 +18,12 @@ type Config struct {
|
||||
Version string `mapstructure:"-"`
|
||||
|
||||
App struct {
|
||||
Host string `mapstructure:"host"`
|
||||
Port int `mapstructure:"port"`
|
||||
CertDir string `mapstructure:"cert_dir"`
|
||||
ProjectDir string `mapstructure:"project_dir"`
|
||||
PluginsDir string `mapstructure:"plugins_dir"`
|
||||
Host string `mapstructure:"host"`
|
||||
Port int `mapstructure:"port"`
|
||||
CertDir string `mapstructure:"cert_dir"`
|
||||
ProjectDir string `mapstructure:"project_dir"`
|
||||
PluginsDir string `mapstructure:"plugins_dir"`
|
||||
UpstreamProxy string `mapstructure:"upstream_proxy"`
|
||||
} `mapstructure:"app"`
|
||||
|
||||
TUI struct {
|
||||
|
||||
@@ -4,6 +4,7 @@ app:
|
||||
cert_dir: ~/.local/share/spilltea
|
||||
project_dir: ~/.local/share/spilltea
|
||||
plugins_dir: ~/.config/spilltea/plugins
|
||||
upstream_proxy: "" # e.g. http://corporate-proxy:8888 or http://user:pass@host:8888
|
||||
|
||||
intercept:
|
||||
default_intercept_enabled: true
|
||||
|
||||
@@ -108,6 +108,7 @@ func Start(broker *intercept.Broker, mgr *plugins.Manager) error {
|
||||
Addr: addr,
|
||||
StreamLargeBodies: 1024 * 1024 * 5,
|
||||
CaRootPath: caPath,
|
||||
Upstream: cfg.UpstreamProxy,
|
||||
}
|
||||
|
||||
p, err := goproxy.NewProxy(opts)
|
||||
|
||||
Reference in New Issue
Block a user