I've written a client/server application which I'm testing on my local machine.
The server reads the IP Address of the client as ::1
which is an IPv6 loopback address.
However, I need to re-establish an HttpClient connection to this client later, by providing a Uri's BaseAddress:
var originalAddress = "::1";
var client = new HttpClient() { BaseAddress = new Uri(originalAddress) };
This results in the exception Invalid URI: The format of the URI could not be determined.
How can I get the Uri to accept this address?