]> Sergey Matveev's repositories - btrtrc.git/blobdiff - config.go
Add customer headers when dialling WS connection to tracker (#789)
[btrtrc.git] / config.go
index 09f9bc1eb07ad099e9f4a63eb608421e4b42c8c0..e1e6452af1699ac8c509f8d25b45846d74096908 100644 (file)
--- a/config.go
+++ b/config.go
@@ -117,6 +117,9 @@ type ClientConfig struct {
        // HttpRequestDirector modifies the request before it's sent.
        // Useful for adding authentication headers, for example
        HttpRequestDirector func(*http.Request) error
+       // WebsocketTrackerHttpHeader returns a custom header to be used when dialing a websocket connection
+       // to the tracker. Useful for adding authentication headers
+       WebsocketTrackerHttpHeader func() http.Header
        // Updated occasionally to when there's been some changes to client
        // behaviour in case other clients are assuming anything of us. See also
        // `bep20`.