From a525375f262b51b9c1b9284fd1135ba44afbcbd7 Mon Sep 17 00:00:00 2001 From: Terence Chan Date: Thu, 8 Oct 2026 01:38:56 +0800 Subject: [PATCH] fix(stream): rename password const to mqttPasswordAnyValue Closes #22. --- stream/client.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stream/client.go b/stream/client.go index a867ff0..a3a0cd9 100644 --- a/stream/client.go +++ b/stream/client.go @@ -36,9 +36,10 @@ import ( "go.opentelemetry.io/otel/trace" ) -// password is sent as the MQTT password. Webull documents that any value is -// accepted; the App Key is carried as the user name. -const password = "webullapi4go" +// mqttPasswordAnyValue is the MQTT password. Webull accepts any non-empty +// value; the App Key is carried as the user name (cfg.AppKey). The literal +// string is an arbitrary placeholder and carries no authentication weight. +const mqttPasswordAnyValue = "webullapi4go" // streamMetrics holds the OTel instruments for stream telemetry. // All fields are nil when neither an explicit nor inherited meter is available. @@ -156,7 +157,7 @@ func New(cl *client.Client, opts ...Option) (*Client, error) { Broker: broker, ClientID: cfg.sessionID, Username: cl.Config().AppKey, - Password: password, + Password: mqttPasswordAnyValue, KeepAlive: cfg.keepAlive, ConnectTimeout: cfg.connectTimeout, WriteTimeout: cfg.writeTimeout,