Need changes in my code so that I can access from esp remotely from any network

See the attachment!

My program is working fine for me in the local network but I want to update this for any other network so that I can access i/o pins of my esp from any other external network, your help will be appreciated!

WiFiAccessPoint_javascript_10.ino (9.84 KB)

it's not an arduino question, it's an LAN/WAN configuration issue... Do you know how to configure your router?