getting through my network

I have a program running that opens and closes a door I am using rest API to do it and it all works while on my home network. I just want o know what needs to be done to be able to control it from outside my network. What I have is a modified version of the bridge code and an arduino yun. What I have tried so far is give my yun a static ip address and since the bridge code says it uses port 5555 I have that port forwarded I also have a dynamic dns account from no ip. so far I can only get to my yun from inside my network I don’t know if there is more network stuff that needs to be done or if I have to change the code some to allow outside access

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

// Listen to the default port 5555, the Yún webserver
// will forward there all the HTTP requests you send
BridgeServer server;

void setup() {
  // Bridge startup
  pinMode(11, OUTPUT);
  digitalWrite(11, HIGH);
  digitalWrite(11, LOW);
  pinMode(12, OUTPUT);
  digitalWrite(12, HIGH);
  digitalWrite(12, LOW);
  // Listen for incoming connection only from localhost
  // (no one from the external network could connect)

void loop() {
  // Get clients coming from server
  BridgeClient client = server.accept();

  // There is a new client?
  if (client) {
    // Process request

    // Close connection and free resources.

  delay(50); // Poll every 50ms

void process(BridgeClient client) {
  // read the command
  String command = client.readStringUntil('/');

  // is "digital" command?
  if (command == "digital") {

void digitalCommand(BridgeClient client) {
  int pin, value;

  // Read pin number
  pin = client.parseInt();

  // If the next character is a '/' it means we have an URL
  // with a value like: "/digital/11/1"
  if ( == '/') {
    value = client.parseInt();
    digitalWrite(pin, value);

     delay(15000);              // wait for 15 seconds while door moves
  digitalWrite(12, LOW);    // turn the motor off by making the voltage LOW
  digitalWrite(11, LOW);    // turn the motor off by making the voltage LOW


Insure your port forwarding rule is correct, and the port 5555 (UDP or TCP) is allowed through the firewall.

As far as I can tell the port forwarding is done for port 5555 both protocols and to that ip address but something doesn't work. From what I have read if I can get it to work in my network getting it to work from outside my network has nothing to do with the code just port forwarding my next question would be this part of the code

server.listenOnLocalhost(); server.begin();

does this have anything to do with it?