3

I'm trying to call a HTTP JSON-RPC server for Bitcoin using Go (not on GAE), but I get error of

dial tcp http://user:[email protected]:8332: too many colons in address

or

dial ip http://user:[email protected]:8332: lookup http://user:[email protected]:8332: no such host

I tried various network configurations, but couldn't get anything going. When I just typed the address into the browser, I got a response from the server:

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

Which looks like a proper response for an empty call.

How do I correctly call that HTTP JSON-RPC server in Go?

0

1 Answer 1

13

Use brackets around the host like this:

[user:[email protected]]:8332

Reference:

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

Sign up to request clarification or add additional context in comments.

1 Comment

It's crazy - but it works! Thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.