Skip to content

Commit

Permalink
ethrpc: client expects ws:// and wss:// for streaming urls
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed Mar 18, 2024
1 parent a06badc commit a65c80f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ethrpc/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ethrpc

import (
"net/http"
"strings"

"github.com/goware/breaker"
"github.com/goware/logger"
Expand All @@ -15,7 +16,10 @@ type httpClient interface {

func WithStreaming(nodeWebsocketURL string) Option {
return func(p *Provider) {
p.nodeWSURL = nodeWebsocketURL
nodeWSURL := nodeWebsocketURL
nodeWSURL = strings.Replace(nodeWSURL, "http://", "ws://", 1)
nodeWSURL = strings.Replace(nodeWSURL, "https://", "wss://", 1)
p.nodeWSURL = nodeWSURL
}
}

Expand Down

0 comments on commit a65c80f

Please sign in to comment.