Configuring W3C's Unicorn to use a proxy server
I've been trying to setup W3C Unicorn on Ubuntu 10 using Tomcat6 but running into a few problems with proxy servers.
I've got Unicorn configured (via tomcat) to use a proxy server using java's -Dhttp.proxyHost and -Dhttp.proxyPort. This works fine and Unicorn is able to download the files it needs.
The problem is that we're trying to use it to validate content on an internal network which requires bypassing the proxy server. I've tried using -Dhttp.nonProxyHosts but nothing seems to be working. Unicorn just keeps giving the following errors whenever I try to validate using a local URL:
From the HTML validator: HTTP Error Unexpected HTTP response 500 Can't connect to some.internal.dom (Bad hostname 'some.internal.dom') while trying to retrieve http://some.internal.dom:4000/
From the HTTP validator: Checker Error Could not connect to the server (No address associated with hostname)
And from the Feed Validator: Server returned (-2, 'Name or service not known') An error occurred while trying to validate this feed.
I've tried everything I can think of but just don't seem to be able to 开发者_JAVA百科get the nonProxyHosts to work. Any suggestions?
Thanks
Discovered after some investigation that Unicorn doesn't actually provide the validation services, it redirects requests to the W3C (or any other configured) validation service. This means the local proxy configuration was irrelevant as the request was being passed to W3C who weren't able to connect to our internal network (obviously), which explains why we were getting the error messages despite the proxy configuration working.
Each of the W3C validators can be downloaded and installed independently, and Unicorn can then be configured to connect to those instead of the official W3C validators.
Took a lot of digging to work this out - the W3C Unicorn site needs to explain things a bit clearer!
精彩评论