Skip to content

Commit 8234074

Browse files
committed
update lua
1 parent 54a5188 commit 8234074

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

Openresty/Nginx/Lua/http-lua-test.lua

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,24 @@ end
2727
--响应体
2828
ngx.say(resp.body)
2929

30-
httpc:close()
30+
httpc:close()
31+
32+
33+
local var = ngx.var
34+
local uri = var.uri
35+
36+
local stream_name = var.stream_name
37+
local auth_key = var.auth_key
38+
local expire_time = string.sub(auth_key,0,10)
39+
local rand = "0"
40+
local uid = "0"
41+
local private_key = "Tinywan123"
42+
local sstring = uri.."-"..expire_time.."-"..rand.."-"..uid.."-"..private_key
43+
local hash_value = ngx.md5(sstring)
44+
45+
ngx.say("URI :: ",uri)
46+
ngx.say("stream_name::",stream_name)
47+
ngx.say("auth_key ::",auth_key)
48+
ngx.say("expire_time :: ",expire_time)
49+
ngx.say("sstring :: ",sstring)
50+
ngx.say("hash_value :: ",hash_value)

Redis/redis-install.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
## Redis 简易安装教程
22
#### 一、安装编译
33
+ 下载、解压
4-
5-
```
4+
```Bash
65
wget http://download.redis.io/releases/redis-3.2.8.tar.gz
7-
tar -zxvf redis-3.2.8.tar.gz
6+
tar -zxvf redis-3.2.8.tar.gz
7+
cd redis-3.2.8
88
```
9-
109
+ make 编译
1110

1211
+ 编译完成之后,可以看到解压文件redis-3.0.7 中会有对应的src、conf等文件
@@ -46,15 +45,11 @@
4645
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
4746
```
4847
+ 3、检测运行端口
49-
5048
```
5149
tinywan@tinywan:/usr/local/redis/etc$ ps -aux | grep redis
52-
5350
tinywan 43725 0.1 0.3 38160 6272 ? Ssl 09:11 0:00 /usr/local/redis/bin/redis-server *:63790
54-
5551
tinywan 43730 0.0 0.0 15984 1060 pts/4 S+ 09:11 0:00 grep --color=auto redis
5652
```
57-
5853
+ 4、redis-cli启动
5954
```
6055
tinywan@tinywan:/usr/local/redis/etc$ redis-cli -h 127.0.0.1 -p 63790

0 commit comments

Comments
 (0)