Skip to content

Commit

Permalink
Merge pull request #729 from gzliudan/ws-port
Browse files Browse the repository at this point in the history
node: allow WebSocket and HTTP works on the same port
  • Loading branch information
gzliudan authored Nov 13, 2024
2 parents 0da60fc + 22ad2f5 commit 5316e9b
Show file tree
Hide file tree
Showing 18 changed files with 538 additions and 713 deletions.
4 changes: 2 additions & 2 deletions cmd/XDC/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ func defaultNodeConfig() node.Config {
cfg := node.DefaultConfig
cfg.Name = clientIdentifier
cfg.Version = params.VersionWithCommit(gitCommit)
cfg.HTTPModules = append(cfg.HTTPModules, "eth", "shh")
cfg.WSModules = append(cfg.WSModules, "eth", "shh")
cfg.HTTPModules = append(cfg.HTTPModules, "eth")
cfg.WSModules = append(cfg.WSModules, "eth")
cfg.IPCPath = "XDC.ipc"
return cfg
}
Expand Down
351 changes: 0 additions & 351 deletions cmd/XDC/monitorcmd.go

This file was deleted.

13 changes: 8 additions & 5 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,15 @@ func setNAT(ctx *cli.Context, cfg *p2p.Config) {

// splitAndTrim splits input separated by a comma
// and trims excessive white space from the substrings.
func splitAndTrim(input string) []string {
result := strings.Split(input, ",")
for i, r := range result {
result[i] = strings.TrimSpace(r)
func splitAndTrim(input string) (ret []string) {
l := strings.Split(input, ",")
for _, r := range l {
r = strings.TrimSpace(r)
if len(r) > 0 {
ret = append(ret, r)
}
}
return result
return ret
}

// setHTTP creates the HTTP RPC listener interface string from the set
Expand Down
Loading

0 comments on commit 5316e9b

Please sign in to comment.