i want to access my website with a external ip but it’s dosen’t work
here’s the code
import processing.net.*;
import processing.video.*;
import java.io.File;
Server myServer;
PrintWriter output;
int nb = 0;
void setup() {
size(200, 200);
// Starts a myServer on port 5204
myServer = new Server(this, 80);
println("ip: " + Server.ip() + ":80");
}
void draw() {
Client client = myServer.available();
if(client != null)
{
String information = client.readString();
output = createWriter(sketchPath("data/lol" + nb + ".txt"));
nb++;
output.write(information);
output.flush();
output.close();
println(information);
println("-------------------------------");
println(client.ip());
client.write("HTTP/1.1 200 OK\r\n");
client.write("Content-Length: 124\r\n");
client.write("Content-Type: text/html\r\n\r\n");
if(match(information,"GET / ")!=null)
{
client.write("<html><head><title>ca marche</title></head><body><h2>coucou</h2><img src='https://image.ibb.co/guGEyp/Tux.jpg' alt='Tux'></body></html>");
}
else if(match(information,"GET /favicon.ico ")!=null)
{
client.write("http://www.iconj.com/ico/u/m/umoqt61f1v.ico");
}
else
{
client.write("<html><head><title>ca marche</title></head><body><h2>coucou t un probleme, mon probleme, je ne trouve pas ta page :(</h2><img src='https://image.ibb.co/guGEyp/Tux.jpg' alt='Tux'></body></html>");
}
delay(100);
client.stop();
}
}