Skip to content

Commit 144791d

Browse files
committed
tes
1 parent 29fefe1 commit 144791d

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

client.lua

+6-15
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,14 @@ local ui = require "simpleui"
1212
local ws_client = require "ws_client"
1313
local httpc = require "http.httpc"
1414

15-
-- print("begin https test")
16-
-- local code, res = httpc.request('GET', 'https://baidu.com')
17-
-- print("https test:" .. code .. inspect(res))
15+
print("begin https test")
16+
local code, res = httpc.request('GET', 'https://baidu.com')
17+
print("https test:" .. code .. inspect(res))
1818

19-
-- print("begin http test")
20-
-- local code, res = httpc.request('GET', 'http://localhost:15672', "/cli/rabbitmqadmin")
21-
-- print("http test:" .. code .. inspect(res))
19+
print("begin http test")
20+
local code, res = httpc.request('GET', 'http://localhost:15672', "/cli/rabbitmqadmin")
21+
print("http test:" .. inspect(res))
2222

23-
-- local sep = '\r\n'
24-
-- local buf = "dsgdgf" .."\r\n" .. "ggg1111"
25-
-- print('bb:', buf)
26-
27-
-- while not buf:find(sep, 1, true) do
28-
-- end
29-
-- local b, e, c = buf:find(sep, 1, true)
30-
-- print('ff:', b, e, buf:sub(1, b))
31-
-- print('cc:', c)
3223

3324
assert(ws_client.connect())
3425
ws_client.loop()

ws_client.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ local function connect()
1818
num = num + 1
1919
end)
2020

21-
local url = "ws://echo.websocket.org"
21+
local url = "wss://echo.websocket.org"
2222
print("Connecting to " .. url)
2323
return ws_client.ws:connect(url)
2424
end
@@ -38,4 +38,4 @@ return {
3838
connect = connect,
3939
loop = loop,
4040
shutdown = shutdown,
41-
}
41+
}

0 commit comments

Comments
 (0)