Refactor: refactor golang flavor

This commit is contained in:
kr328
2021-09-11 18:27:02 +08:00
parent 11c4e19e0c
commit e364af393a
54 changed files with 16 additions and 12 deletions

View File

@@ -0,0 +1,23 @@
package main
//#include "bridge.h"
import "C"
import "cfa/proxy"
//export startHttp
func startHttp(listenAt C.c_string) *C.char {
l := C.GoString(listenAt)
listen, err := proxy.Start(l)
if err != nil {
return nil
}
return C.CString(listen)
}
//export stopHttp
func stopHttp() {
proxy.Stop()
}