My browser sees directly the web page's code sent by my Yun !

Hello !

I try to create a web server on my Arduino Yun.
That's why I need to use Bridge's Libraries (usefull for Yun users).

But when I connect to my arduino, it sends me a web page directly formated in code (I see on my browser the html code !)
I would like not to see "<!Doctype html>" on my webpage !!!

What is wrong on my code ?

#include <Bridge.h>
#include <BridgeServer.h>
#include <BridgeClient.h>
BridgeServer server;


void setup() {
  Bridge.begin();
  server.begin();

}

void loop() {
  BridgeClient client = server.accept();
  if (client) {
    // Process request
  client.println("<!Doctype html>");
  client.println("<html>");
  client.println("<head>");
  client.println("<title>Arduino Web Page</title>");
  client.println("</head>");
  client.println("<body>");
  client.println("<h1>Hello from Arduino grr !!!</h1>");
  client.println("<p>A web page from the Arduino server</p>");
  client.println("</body>");
  client.println("</html>");

  // Close connection and free resources.
  client.stop();
  }
}

Thanks for your help !!

(deleted)

Thanks, but it still doesn't work.

Here is my web page seen by firefox :

HTTP/1.1 200 OK
Content-Type: text/html
Connection: close

Hello from Arduino grr !!!

A web page from the Arduino server

Someo

Have you tried other browsers, especially Chrome or IE (or Microsoft Edge)?

You are not reading what the client is requesting, nor telling the browser what you are sending and you expect it to know that the data is a webpage?

Have a look at the WebServerST example in the playground.

Firstly you need to see what the client wants, then if the request is indeed for an HTML page, you send a 200 OK header with the correct content type (text/html), for just then sending the whole HTML page code (that you are trying to send on your script).

@Ungrandy,
There are actually two (2) webservers running on the Yun. On on the Linux side (that give you the webpage) and one that is on the AtMega.

It appears you want to disable or nullify the full websever on the Linux. Is this correct?

Jesse