mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
rasras
This commit is contained in:
@ -16,6 +16,6 @@ frontend http-in
|
||||
# http-request lua.test-payload
|
||||
http-request use-service lua.hello-world if { path /hello_world }
|
||||
http-request use-service lua.hcaptcha-view if { path /captcha }
|
||||
|
||||
http-request use-service lua.ratelimit if { path /test }
|
||||
backend servers
|
||||
server server1 nginx:80 maxconn 32
|
||||
|
8
scripts/counter.lua
Normal file
8
scripts/counter.lua
Normal file
@ -0,0 +1,8 @@
|
||||
--
|
||||
-- Created by IntelliJ IDEA.
|
||||
-- User: dinoz
|
||||
-- Date: 08.06.2021
|
||||
-- Time: 15:28
|
||||
-- To change this template use File | Settings | File Templates.
|
||||
--
|
||||
|
1203
scripts/redis.lua
Normal file
1203
scripts/redis.lua
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,9 @@ package.path = package.path .. "./?.lua;/usr/local/etc/haproxy/scripts/?.lua"
|
||||
|
||||
require("guard")
|
||||
require("hcaptcha")
|
||||
require("test")
|
||||
|
||||
core.register_service("hello-world", "http", guard.hello_world)
|
||||
core.register_service("hcaptcha-view", "http", hcaptcha.view)
|
||||
--core.register_service("hello-world", "http", guard.hello_world)
|
||||
--core.register_service("hcaptcha-view", "http", hcaptcha.view)
|
||||
--core.register_service("test", "http", test.hello_world2)
|
||||
core.register_service("ratelimit", "http", test.ratelimit)
|
||||
|
6
scripts/test.lua
Normal file
6
scripts/test.lua
Normal file
@ -0,0 +1,6 @@
|
||||
package.path = package.path .. "./?.lua;/usr/local/etc/haproxy/scripts/?.lua"
|
||||
|
||||
local redis = require 'redis'
|
||||
client = redis.connect('127.0.0.1', 6379)
|
||||
response = client:ping()
|
||||
|
8
scripts/test2.lua
Normal file
8
scripts/test2.lua
Normal file
@ -0,0 +1,8 @@
|
||||
package.path = package.path .. "./?.lua;/usr/local/etc/haproxy/scripts/?.lua"
|
||||
require("redis")
|
||||
|
||||
local redis = require 'redis'
|
||||
local client = redis.connect('127.0.0.1', 6379)
|
||||
local response = client:ping()
|
||||
local dummy = client:get('dummy')
|
||||
print(dummy)
|
Reference in New Issue
Block a user