#!../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())

