Skip to content

Commit

Permalink
Added window proxy options
Browse files Browse the repository at this point in the history
  • Loading branch information
asticode committed Jul 29, 2018
1 parent 96af54c commit 0591884
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion astilectron.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
// Versions
const (
DefaultAcceptTCPTimeout = 30 * time.Second
VersionAstilectron = "0.26.0"
VersionAstilectron = "0.27.0"
VersionElectron = "1.8.1"
)

Expand Down
1 change: 1 addition & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
// Session represents a session
// TODO Add missing session methods
// TODO Add missing session events
// https://github.com/electron/electron/blob/v1.8.1/docs/api/session.md
type Session struct {
*object
}
Expand Down
9 changes: 9 additions & 0 deletions window.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ type WindowOptions struct {
// Additional options
Custom *WindowCustomOptions `json:"custom,omitempty"`
Load *WindowLoadOptions `json:"load,omitempty"`
Proxy *WindowProxyOptions `json:"proxy,omitempty"`
}

// WindowCustomOptions represents window custom options
Expand All @@ -136,6 +137,14 @@ type WindowLoadOptions struct {
UserAgent string `json:"userAgent,omitempty"`
}

// WindowProxyOptions represents window proxy options
// https://github.com/electron/electron/blob/v1.8.1/docs/api/session.md#sessetproxyconfig-callback
type WindowProxyOptions struct {
BypassRules string `json:"proxyBypassRules,omitempty"`
PACScript string `json:"pacScript,omitempty"`
Rules string `json:"proxyRules,omitempty"`
}

// WebPreferences represents web preferences in window options.
// We must use pointers since GO doesn't handle optional fields whereas NodeJS does.
// Use PtrBool, PtrInt or PtrStr to fill the struct
Expand Down

0 comments on commit 0591884

Please sign in to comment.