Go - JSON-RPC - Too Many Colons

I try to call the JSON-RPC HTTP server for Bitcoin using Go (not for GAE), but I get an error

dial tcp http://user: pass@127.0.0.1 :8332: too many colons in address 

or

 dial ip http://user: pass@127.0.0.1 :8332: lookup http://user: pass@127.0.0.1 :8332: no such host 

I tried various network configurations but could not achieve anything. When I just typed the address in the browser, I received a response from the server:

 {"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null} 

It looks like the right answer for an empty call.

How to properly call this HTTP JSON-RPC server in Go?

+1
source share
1 answer

Use parentheses around the host as follows:

 [user: pass@127.0.0.1 ]:8332 

Link:

http://golang.org/src/pkg/net/ipsock.go?s=2247:2304#L68

+7
source

Source: https://habr.com/ru/post/906353/


All Articles