2018-10-09 14:18:10 +08:00
|
|
|
package main // import "github.com/yichengchen/clashX/ClashX"
|
2018-10-02 10:58:56 +08:00
|
|
|
import (
|
|
|
|
"C"
|
2019-03-01 11:24:31 +08:00
|
|
|
"os"
|
2018-10-02 10:58:56 +08:00
|
|
|
|
|
|
|
"github.com/Dreamacro/clash/hub"
|
2019-03-01 11:24:31 +08:00
|
|
|
"github.com/Dreamacro/clash/hub/route"
|
2018-10-02 10:58:56 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
//export run
|
|
|
|
func run() *C.char {
|
2019-03-17 20:24:32 +08:00
|
|
|
// enable tls 1.3 and remove when go 1.13
|
|
|
|
os.Setenv("GODEBUG", os.Getenv("GODEBUG")+",tls13=1")
|
2018-11-30 21:35:09 +08:00
|
|
|
if err := hub.Parse(); err != nil {
|
2018-10-02 10:58:56 +08:00
|
|
|
return C.CString(err.Error())
|
|
|
|
}
|
|
|
|
|
2018-11-30 21:35:09 +08:00
|
|
|
return C.CString("success")
|
2018-10-14 23:42:53 +08:00
|
|
|
}
|
2018-11-30 21:35:09 +08:00
|
|
|
|
2018-12-21 10:18:01 +08:00
|
|
|
//export setUIPath
|
2018-12-21 22:22:15 +08:00
|
|
|
func setUIPath(path *C.char) {
|
|
|
|
route.SetUIPath(C.GoString(path))
|
2018-12-21 10:18:01 +08:00
|
|
|
}
|
|
|
|
|
2018-10-02 10:58:56 +08:00
|
|
|
func main() {
|
2019-03-17 20:24:32 +08:00
|
|
|
|
2018-10-02 10:58:56 +08:00
|
|
|
}
|