upgrade version

addon-dailer
lqqyt2423 3 years ago
parent 0848dd8a28
commit b883408664

@ -15,8 +15,6 @@ import (
log "github.com/sirupsen/logrus"
)
const version = "0.1.4"
type Config struct {
version bool
@ -48,11 +46,6 @@ func loadConfig() *Config {
func main() {
config := loadConfig()
if config.version {
fmt.Println("go-mitmproxy: " + version)
os.Exit(0)
}
// for debug
// slog.SetFlags(slog.LstdFlags | slog.Lshortfile)
// log.SetReportCaller(true)
@ -64,8 +57,6 @@ func main() {
FullTimestamp: true,
})
log.Infof("go-mitmproxy version %v\n", version)
opts := &proxy.Options{
Addr: config.addr,
StreamLargeBodies: 1024 * 1024 * 5,
@ -77,6 +68,13 @@ func main() {
log.Fatal(err)
}
if config.version {
fmt.Println("go-mitmproxy: " + p.Version)
os.Exit(0)
}
log.Infof("go-mitmproxy version %v\n", p.Version)
p.AddAddon(&addon.Log{})
p.AddAddon(web.NewWebAddon(config.webAddr))

@ -22,6 +22,7 @@ type Options struct {
}
type Proxy struct {
Version string
Server *http.Server
Client *http.Client
Interceptor Interceptor
@ -31,6 +32,7 @@ type Proxy struct {
func NewProxy(opts *Options) (*Proxy, error) {
proxy := new(Proxy)
proxy.Version = "0.1.5"
proxy.Server = &http.Server{
Addr: opts.Addr,

Loading…
Cancel
Save