Make Ethernet board + Arduino = Serial Ethernet

I’ve tried to make some code so i could communicate with the Arduino, which then communicates with the Ethernet board and send what it recieves from the Serial.
This is my code, but it doesn’t work:

#include <Ethernet.h>

// network configuration.  gateway and subnet are optional.
byte mac[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 };
byte ip[] = { 192, 168, 1, 111 };

int receivedByte = 0; // Used when recieving HTTP DATA from uC

Server server = Server(80);
unsigned long time;

void setup()
  // initialize the ethernet device
  Ethernet.begin(mac, ip);
  // start listening for clients
  Serial.begin(9600);          //  setup serial

void loop()

  Client client = server.available();
  if (client) {
    Serial.print(2, BYTE); //Tell that a client has connected
    while (!Serial.available()) {
      // Wait on what to send
    while (Serial.available()) {
      receivedByte =;

    client.stop();//close the connection with the client
    delay(1000);//pause wait  for a new connection

I think

if (client) {

Should be

if (client.connected()) {

But I do not really know.

No, that isn't the problem. As i recieve the 02 byte when i go to the webadress in my browser.

But then if i send the data which i want to output to the browser, then it just writes some numbers - and what i get back on the serial, which should be the same, isn't the same! It's some crappy numbers!

No one who can help me?

You might get a better response if you post the actual data you are trying to send and what you actually receive.