mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
x.websocket: add header to client (#9517)
This commit is contained in:
committed by
GitHub
parent
3ced970b17
commit
9b9ef5fe1b
@@ -4,6 +4,7 @@
|
||||
module websocket
|
||||
|
||||
import net
|
||||
import net.http
|
||||
import x.openssl
|
||||
import net.urllib
|
||||
import time
|
||||
@@ -30,6 +31,7 @@ pub:
|
||||
uri Uri // uri of current connection
|
||||
id string // unique id of client
|
||||
pub mut:
|
||||
header http.Header // headers that will be passed when connecting
|
||||
conn &net.TcpConn // underlying TCP socket connection
|
||||
nonce_size int = 16 // size of nounce used for masking
|
||||
panic_on_callback bool // set to true of callbacks can panic
|
||||
@@ -85,6 +87,7 @@ pub fn new_client(address string) ?&Client {
|
||||
uri: uri
|
||||
state: .closed
|
||||
id: rand.uuid_v4()
|
||||
header: http.new_header()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,5 +489,6 @@ pub fn (c &Client) free() {
|
||||
c.error_callbacks.free()
|
||||
c.open_callbacks.free()
|
||||
c.close_callbacks.free()
|
||||
c.header.free()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user