# How can i access my server with a external ip?

**URL:** https://discourse.processing.org/t/how-can-i-access-my-server-with-a-external-ip/4739
**Category:** Libraries
**Created:** [October 22, 2018, 9:57am UTC](https://discourse.processing.org/t/how-can-i-access-my-server-with-a-external-ip/4739 "2018-10-22T09:57:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Quix](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quix/32/2011_2.png) [@Quix](https://discourse.processing.org/u/Quix)
#### Post date: [October 22, 2018, 9:57am UTC](https://discourse.processing.org/t/how-can-i-access-my-server-with-a-external-ip/4739/1 "2018-10-22T09:57:08Z")

</div>

i want to access my website with a external ip but it’s dosen’t work  
here’s the code

```auto
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();
  }
}

```

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [October 22, 2018, 2:03pm UTC](https://discourse.processing.org/t/how-can-i-access-my-server-with-a-external-ip/4739/2 "2018-10-22T14:03:43Z")

</div>

what you have is a webserver on your ?PC? what can be called with its local IP from within the network  
correct?

if you want to call that webserver from the “outside” internet

- -a- you need to know the IP of your home router( browser check my ip )

- -b- when you then contact your router from outside it must know that you want to talk to the local PC with the local IP you see from the processing.

- -c- testing can be difficult , so its good to be “outside” like with some free internet tools ( VPN and proxy service ) so you can call back your home, because also your router might not allow to talk from inside via outside to inside …

---

<div class="post-metadata">

### Author: ![Quix](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quix/32/2011_2.png) [@Quix](https://discourse.processing.org/u/Quix)
#### Post date: [October 22, 2018, 3:40pm UTC](https://discourse.processing.org/t/how-can-i-access-my-server-with-a-external-ip/4739/3 "2018-10-22T15:40:58Z")

</div>

idk what i do but it’s work 😃
