Can a TCP web server work without Internet connection?

No, I'd advise against AUTOMATIC, since your code will only start running after your device got cloud connected at least once.
The easiest is SEMI_AUTOMATIC - as suggested earlier.

What do you consider secure?
WPA2 Personal is the "most secure" WiFi encryption supported by the Particles, but if you want more then that, you'd need to add encryption to your code since TCPServer/TCPClient are not encrypted beyond what the WiFi layer does while "in air".
But you could have a look at the HTTPS library provided by the glowfi.sh team
HTTPS client is here for the Photon! - by the glowfi.sh Team

1 Like