Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh: support ws endpoint #195

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion taosWS/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func newTaosConn(cfg *config) (*taosConn, error) {
endpointUrl := &url.URL{
Scheme: cfg.net,
Host: fmt.Sprintf("%s:%d", cfg.addr, cfg.port),
Path: "/rest/ws",
Path: "/ws",
}
if cfg.token != "" {
endpointUrl.RawQuery = fmt.Sprintf("token=%s", cfg.token)
Expand Down
4 changes: 2 additions & 2 deletions ws/schemaless/schemaless.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func NewSchemaless(config *Config) (*Schemaless, error) {
if wsUrl.Scheme != "ws" && wsUrl.Scheme != "wss" {
return nil, errors.New("config url scheme error")
}
if len(wsUrl.Path) == 0 || wsUrl.Path != "/rest/schemaless" {
wsUrl.Path = "/rest/schemaless"
if len(wsUrl.Path) == 0 || wsUrl.Path != "/ws" {
wsUrl.Path = "/ws"
}
ws, _, err := common.DefaultDialer.Dial(wsUrl.String(), nil)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion ws/schemaless/schemaless_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestSchemaless_Insert(t *testing.T) {
}
defer func() { _ = after() }()

s, err := NewSchemaless(NewConfig("ws://localhost:6041/rest/schemaless", 1,
s, err := NewSchemaless(NewConfig("ws://localhost:6041/ws", 1,
SetDb("test_schemaless_ws"),
SetReadTimeout(10*time.Second),
SetWriteTimeout(10*time.Second),
Expand Down
2 changes: 1 addition & 1 deletion ws/stmt/stmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func TestStmt(t *testing.T) {
}
defer cleanEnv()
now := time.Now()
config := NewConfig("ws://127.0.0.1:6041/rest/stmt", 0)
config := NewConfig("ws://127.0.0.1:6041/ws", 0)
config.SetConnectUser("root")
config.SetConnectPass("taosdata")
config.SetConnectDB("test_ws_stmt")
Expand Down
Loading