From 61f4e1830191f6e2524c3f15962d8936cc80d2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Sun, 1 Jan 2017 14:15:37 +0100 Subject: [PATCH] Use an executable example for net.socket:on() --- docs/en/modules/net.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/modules/net.md b/docs/en/modules/net.md index fadcaefc..0fa4cf39 100644 --- a/docs/en/modules/net.md +++ b/docs/en/modules/net.md @@ -310,11 +310,11 @@ Otherwise, all connection errors (with normal close) passed to disconnection eve ```lua srv = net.createConnection(net.TCP, 0) srv:on("receive", function(sck, c) print(c) end) -srv:on("connection", function(sck) +srv:on("connection", function(sck, c) -- Wait for connection before sending. - sck:send("GET / HTTP/1.1\r\nHost: 192.168.0.66\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n") + sck:send("GET /get HTTP/1.1\r\nHost: httpbin.org\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n") end) -srv:connect(80,"192.168.0.66") +srv:connect(80,"httpbin.org") ``` #### See also