mirror of
https://github.com/Baipyrus/ProxySwitcher.git
synced 2024-12-27 05:01:45 +00:00
do not apply proxy if discard option is set
This commit is contained in:
parent
7ddc733172
commit
b2dda4afbc
@ -26,8 +26,8 @@ func readArgs(replaceVariable bool, args []string, configCmd string) ([]string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func applyProxy(configArgs []string, configCmd, proxyServer string, variant *util.Variant) ([]string, string) {
|
func applyProxy(configArgs []string, configCmd, proxyServer string, variant *util.Variant) ([]string, string) {
|
||||||
// Skip, no proxy provided
|
// Skip, no proxy provided or proxy option discarded
|
||||||
if proxyServer == "" {
|
if proxyServer == "" || variant.DiscardProxy {
|
||||||
return configArgs, configCmd
|
return configArgs, configCmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,9 +15,10 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Variant struct {
|
type Variant struct {
|
||||||
Arguments []string `json:"args"`
|
Arguments []string `json:"args"`
|
||||||
Type VariantType `json:"type,omitempty"`
|
Type VariantType `json:"type,omitempty"`
|
||||||
Equator string `json:"equator,omitempty"`
|
Equator string `json:"equator,omitempty"`
|
||||||
|
DiscardProxy bool `json:"discard,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Command struct {
|
type Command struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user