Categories
Arduino Hardware Programming Tutorial

Accessing Virtual Hosts with Arduino Ethernet Shield

If you've worked with the Arduino Ethernet Shield, you've probably noticed a limitation: while you can connect to an IP address, you can only reach the default virtual host on that server. This becomes a problem when working with shared hosting or VPS servers that host multiple websites on a single IP address.

The Problem

Modern web servers commonly use virtual hosting to serve multiple websites from a single IP address. When you make a basic HTTP request to an IP, the server returns the default site—not necessarily the one you want. On commercial shared hosting, you typically can't make your site the default host.

Categories
Arduino Platform Projects

Arduino Ethernet Shield and Webclient

When you first get an Ethernet Shield for your Arduino (I'm using a Duemilanove), the natural thing to do is upload the example sketches to test it out. Everything was working perfectly until I hit the WebClient sketch—it just wouldn't connect.

The Problem

The WebClient example sketch that comes with the Arduino Ethernet library is designed to connect to a web server and fetch a page. The default example tries to connect to Google, but it kept failing on my setup. The frustrating part was that the WebServer sketch worked flawlessly, so I knew the shield itself was fine.