mirror of
https://github.com/luscis/openlan.git
synced 2025-10-05 16:47:11 +08:00
fea: access for ceci.
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"flag"
|
||||
|
||||
"github.com/luscis/openlan/pkg/access"
|
||||
"github.com/luscis/openlan/pkg/config"
|
||||
"github.com/luscis/openlan/pkg/libol"
|
||||
"github.com/luscis/openlan/pkg/proxy"
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
func main() {
|
||||
mode := "http"
|
||||
conf := ""
|
||||
flag.StringVar(&mode, "mode", "http", "Proxy mode for http, socks or tcp")
|
||||
flag.StringVar(&mode, "mode", "http", "Proxy mode for http, socks, tcp and access")
|
||||
flag.StringVar(&conf, "conf", "ceci.yaml", "The configuration file")
|
||||
flag.Parse()
|
||||
|
||||
@@ -30,13 +31,25 @@ func main() {
|
||||
}
|
||||
p := proxy.NewSocksProxy(c)
|
||||
libol.Go(p.Start)
|
||||
} else {
|
||||
} else if mode == "tcp" {
|
||||
c := &config.TcpProxy{Conf: conf}
|
||||
if err := c.Initialize(); err != nil {
|
||||
return
|
||||
}
|
||||
p := proxy.NewTcpProxy(c)
|
||||
libol.Go(p.Start)
|
||||
} else if mode == "access" {
|
||||
c := &config.Point{
|
||||
RequestAddr: true,
|
||||
Terminal: "off",
|
||||
Conf: conf,
|
||||
}
|
||||
if err := c.Initialize(); err != nil {
|
||||
return
|
||||
}
|
||||
p := access.NewPoint(c)
|
||||
p.Initialize()
|
||||
libol.Go(p.Start)
|
||||
}
|
||||
libol.SdNotify()
|
||||
libol.Wait()
|
||||
|
Reference in New Issue
Block a user