Hello world/Web server: Difference between revisions
Content added Content deleted
m (→{{header|Phix}}: once) |
m (Fixed capitalization) |
||
Line 1,137: | Line 1,137: | ||
{{libheader|LuaSocket}} |
{{libheader|LuaSocket}} |
||
<lang lua>local socket = require "socket" |
<lang lua>local socket = require "socket" |
||
local headers = "HTTP/1.1 200 OK\r\ |
local headers = "HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=UTF-8\r\nContent-Length: %d\r\n\r\n%s" |
||
local content = "<!doctype html><html><title>Goodbye, World!</title><h1>Goodbye, World!" |
local content = "<!doctype html><html><title>Goodbye, World!</title><h1>Goodbye, World!" |
||
local server = assert(socket.bind("localhost", 8080)) |
local server = assert(socket.bind("localhost", 8080)) |