Skip to content

Commit b24a74e

Browse files
authored
Merge pull request #94 from CodeWithTamim/fix/export-for-cgo
Fix : Export RunXrayFromJSON in CGO
2 parents d3408e3 + 36ff11b commit b24a74e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

build/template/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ func CGoResetDns() *C.char {
1515
return C.CString(ResetDns())
1616
}
1717

18+
//export CGoRunXrayFromJSON
19+
func CGoRunXrayFromJSON(base64Text *C.char) *C.char {
20+
text := C.GoString(base64Text)
21+
return C.CString(RunXrayFromJSON(text))
22+
}
23+
1824
//export CGoGetFreePorts
1925
func CGoGetFreePorts(count int) *C.char {
2026
return C.CString(GetFreePorts(count))

0 commit comments

Comments
 (0)