holds a single "page" in memory, serves it to the first visitor, and evaporates.
Let's try to remake OneTimeWebServer
products. And let's enjoy the variety of OneTimeWebServer
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
self.send_header('content-type',('text/plain','text/html')[t == '<'])
t = sys.stdin.read() or 'one time web server'
try: p = int(sys.argv)
except: p = 0
httpd = HTTPServer(('',p),handler)
print '> http://%s:%d/' % (httpd.server_name,httpd.server_port)
Anyone want to provide a C version?
Very nice. I'm not sure how much use it is, but it's very nice.
Sounds like a hacker/security pattern. Perhaps. Could be used to provide very specific, personal, and confidential information to a single browser.
Do you mean "cracker"?
I don't think so, although I suppose there is a use in such a realm.
Not cracker - because this would be setup server-side, right? So some sysadmin might want a disappearing backdoor for something - just in case - maybe it lets you issue one command-line command, and then disappears until you can set up the vanishing web server locally. . . Hacker in that context means "someone who needs/makes a quick hack to get something to work" - not someone who breaks into others' systems.
Couple this with ZeroConf and we have something...
What is the term for this kind of technique? It's not quite a pattern, maybe a trick, not really a feature. . .What are neat little pattern/feature/tricks like this called?
Seems to fall into the same category as NullObject
where you more or less hack an object to temporarily stand in for something greater, which just now simply is not (yet) there.