Skip to content

Commit 5316e9b

Browse files
authored
Merge pull request #729 from gzliudan/ws-port
node: allow WebSocket and HTTP works on the same port
2 parents 0da60fc + 22ad2f5 commit 5316e9b

File tree

18 files changed

+538
-713
lines changed

18 files changed

+538
-713
lines changed

cmd/XDC/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ func defaultNodeConfig() node.Config {
120120
cfg := node.DefaultConfig
121121
cfg.Name = clientIdentifier
122122
cfg.Version = params.VersionWithCommit(gitCommit)
123-
cfg.HTTPModules = append(cfg.HTTPModules, "eth", "shh")
124-
cfg.WSModules = append(cfg.WSModules, "eth", "shh")
123+
cfg.HTTPModules = append(cfg.HTTPModules, "eth")
124+
cfg.WSModules = append(cfg.WSModules, "eth")
125125
cfg.IPCPath = "XDC.ipc"
126126
return cfg
127127
}

cmd/XDC/monitorcmd.go

Lines changed: 0 additions & 351 deletions
This file was deleted.

cmd/utils/flags.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -768,12 +768,15 @@ func setNAT(ctx *cli.Context, cfg *p2p.Config) {
768768

769769
// splitAndTrim splits input separated by a comma
770770
// and trims excessive white space from the substrings.
771-
func splitAndTrim(input string) []string {
772-
result := strings.Split(input, ",")
773-
for i, r := range result {
774-
result[i] = strings.TrimSpace(r)
771+
func splitAndTrim(input string) (ret []string) {
772+
l := strings.Split(input, ",")
773+
for _, r := range l {
774+
r = strings.TrimSpace(r)
775+
if len(r) > 0 {
776+
ret = append(ret, r)
777+
}
775778
}
776-
return result
779+
return ret
777780
}
778781

779782
// setHTTP creates the HTTP RPC listener interface string from the set

0 commit comments

Comments
 (0)