go get github.com/MixinNetwork/bot-api-go-client/v4
Set a User-Agent that identifies your application during startup, before making requests:
import bot "github.com/MixinNetwork/bot-api-go-client/v4"
bot.SetUserAgent("my-app/1.0 (+https://example.com)")If the User-Agent is empty or still uses the SDK default, the SDK logs a warning
once when it sends an HTTP request. SetUserAgent configures the whole process;
call it before starting concurrent requests.
For more info, see api.
Blaze uses github.com/coder/websocket to exchange gzip-compressed binary
messages. If you previously called SetupDailer, configure the client with
SetDialOptions before Loop. For example, to customize the five-second
handshake timeout, use the following Go code.
client.SetDialOptions(&websocket.DialOptions{
HTTPClient: &http.Client{Timeout: 10 * time.Second},
})Use the HTTP client's transport to configure TLS and proxies. Blaze supplies
the authorization, request ID, User-Agent, and Mixin-Blaze-1 subprotocol.
It declines redirects because the token signs the original request URI.
Browser WebAssembly cannot send the HTTP headers required for Blaze authentication.