blob: 0885c5560c0d3f17af712d1ba6c1547fc41da76e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!../luxio-5.1
package.path = package.path .. ":../?.lua"
package.cpath = package.cpath .. ":../?.so"
sio = require "luxio.simple"
mysock = assert(sio.connect("www.rjek.com", "http"))
print("mysock: " .. tostring(mysock))
print "Sending request..."
assert(mysock:writev("GET / HTTP/1.1\r\n",
"Host: www.rjek.com\r\n",
"Connection: close\r\n",
"\r\n"))
print "Reading reply..."
print(assert(mysock:read "*a"))
print "Closing socket..."
assert(mysock:close())
|