diff options
Diffstat (limited to 'docs/md')
| -rw-r--r-- | docs/md/apidocs.md | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/docs/md/apidocs.md b/docs/md/apidocs.md index 71713e6..2769a27 100644 --- a/docs/md/apidocs.md +++ b/docs/md/apidocs.md @@ -605,6 +605,63 @@ Example Input: ```InState(5)``` Example Output: ```1, null``` +## NewProxyguard +Signature: + +```go +func NewProxyguard(c C.uintptr_t, lp C.int, tcpsp C.int, peer *C.char, proxySetup C.ProxySetup) (C.uintptr_t, *C.char) +``` + +NewProxyguard creates the 'proxyguard' procedure in eduvpn-common. If the +proxy cannot be created it returns an error. + +This function proxies WireGuard UDP connections over HTTP: [ProxyGuard on +Codeberg](https://codeberg.org/eduvpn/proxyguard). + +These input variables can be gotten from the configuration that is retrieved +using the `proxy` JSON key + + - `c` is the cookie. Note that if you cancel/delete the cookie, + ProxyGuard gets cleaned up. Common automatically cleans up ProxyGuard + when `Cleanup` is called, but it is good to cleanup yourself too. + - `lp` is the `port` of the local udp ProxyGuard connection, this is what + is set to the WireGuard endpoint + - `tcpsp` is the TCP source port. Pass 0 if you do not route based on + source port, so far only the Linux client has to pass non-zero. + - `peer` is the `ip:port` of the remote server + - `proxySetup` is a callback which is called when the socket is setting + up, this can be used for configuring routing in the client. It takes + two arguments: the file descriptor (integer) and a JSON list of IPs the + client connects to + +Example Input: ```NewProxyguard(myCookie, 1337, 0, "5.5.5.5:51820", +proxySetupCB)``` + +Example Output: ```null``` + +## ProxyguardPeerIPs +Signature: + +```go +func ProxyguardPeerIPs(proxyH C.uintptr_t) (*C.char, *C.char) +``` + +ProxyguardPeerIPs gets the Peer IPs configured by ProxyGuard Example Input: +```ProxyguardPeerIPs(handle)``` + +Example Output: ```["1.1.1.1"], null``` + +## ProxyguardTunnel +Signature: + +```go +func ProxyguardTunnel(c C.uintptr_t, proxyH C.uintptr_t, wglisten C.int) *C.char +``` + +ProxyguardTunnel starts the tunneling for ProxyGuard `c` is the cookie +`proxyH` is the proxy handle `wglisten` is the port WireGuard is listening +on + ## Register Signature: |
