From 3c51eaad9619b19c1b1a18abeb8b1bcefcc24867 Mon Sep 17 00:00:00 2001 From: a Date: Mon, 26 Jun 2023 03:27:55 -0500 Subject: [PATCH] add socket --- cloudflare/socket.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cloudflare/socket.go b/cloudflare/socket.go index 0001e4e..d6cec99 100644 --- a/cloudflare/socket.go +++ b/cloudflare/socket.go @@ -78,6 +78,10 @@ type TCPSocket struct { cn context.CancelFunc } +func (t *TCPSocket) Socket() js.Value { + return t.socket +} + // Read reads data from the connection. // Read can be made to time out and return an error after a fixed // time limit; see SetDeadline and SetReadDeadline. @@ -122,7 +126,7 @@ func (t *TCPSocket) Write(b []byte) (n int, err error) { } // StartTls will call startTls on the socket -func (t *TCPSocket) Close() error { +func (t *TCPSocket) StartTls() error { t.socket.Call("startTls") return nil }