Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Feature request: behavior similar curl --resolve #45

noteed opened this Issue · 3 comments

2 participants


Using http-stream's setHostname makes it possible for instance to test a Nginx virtual server served from This is similar to curl -H 'Host: hostname'

But to work with HTTPS, it is better to use curl --resolve 'hostname:80:' hostname so that certificates can be checked for the correct hostname, instead of

It would be great to have somthing similar to --resolve in http-streams.


I'm sorry, I don't really understand what you're trying to do. You can use hostnames when calling openConnectionSSL.



Say you have two development sites hosted as Nginx virtual servers locally, on If you curl, you will get one or the other site, depending on which one is considered the default one by Nginx.

You can make sure to get the one you want by setting the Host header with -H 'Host: hostname'. In that case Nginx will choose the correct virtual server.

But now if you use https instead of http, this will fail as the certificate for that hostname is for a real IP, not Curl provides the --resolve option for that use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.