-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aae3143
commit 2599258
Showing
5 changed files
with
36 additions
and
50 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//go:build ignoreunix | ||
// +build ignoreunix | ||
|
||
package main | ||
|
||
import ( | ||
"syscall/js" | ||
|
||
"github.com/hiddify/ray2sing/ray2sing" | ||
) | ||
|
||
func main() { | ||
c := make(chan struct{}, 0) | ||
|
||
// Expose the function to JavaScript | ||
js.Global().Set("callGoFunction", js.FuncOf(callGoFunction)) | ||
|
||
<-c | ||
} | ||
|
||
func callGoFunction(this js.Value, args []js.Value) (string, error) { | ||
input := args[0].String() | ||
|
||
// Process the input and generate output | ||
output, err := ray2sing.Ray2Singbox(input) | ||
|
||
return output, err | ||
} |