forked from nfx/slrp
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
50 lines (45 loc) · 1.16 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
"context"
"embed"
"flag"
"fmt"
"github.com/nfx/slrp/app"
"github.com/nfx/slrp/checker"
"github.com/nfx/slrp/dialer"
"github.com/nfx/slrp/history"
"github.com/nfx/slrp/internal/updater"
"github.com/nfx/slrp/ipinfo"
"github.com/nfx/slrp/pool"
"github.com/nfx/slrp/probe"
"github.com/nfx/slrp/refresher"
"github.com/nfx/slrp/serve"
"github.com/nfx/slrp/stats"
)
var version = "devel"
//go:embed ui/build/*
var embedFrontend embed.FS
func main() {
updatePtr := flag.Bool("update", false, "check for updates")
flag.Parse()
if *updatePtr {
updater.AutoUpdate(version)
}
fmt.Printf("slrp v%s\n", version)
app.Run(context.Background(), app.Factories{
"ca": serve.NewCA,
"blacklist": probe.NewBlacklistApi,
"checker": checker.NewChecker,
"dashboard": serve.NewDashboard,
"dialer": dialer.NewDialer,
"history": history.NewHistory,
"ipinfo": ipinfo.NewLookup,
"mitm": serve.NewMitmProxyServer,
"pool": pool.NewPool,
"probe": probe.NewProbe,
"refresher": refresher.NewRefresher,
"reverify": probe.NewReverifyApi,
"stats": stats.NewStats,
"ui": app.MountSpaUI(embedFrontend),
})
}