Skip to content

Instantly share code, notes, and snippets.

View cyanide-burnout's full-sized avatar

Artem Prilutskiy cyanide-burnout

View GitHub Profile
@cyanide-burnout
cyanide-burnout / guard.lua
Last active November 12, 2023 00:53
IP- and cookie-based authorization guard for haproxy
--[[
IP- and cookie-based authorization guard for haproxy
https://www.haproxy.com/blog/5-ways-to-extend-haproxy-with-lua/
Guard checks permit in memcached, any value of key 'Allow-Address-<Address>' or 'Allow-Session-<Session>' will be accepted
Where:
<Address> is client's IP-address
<Session> is value of cookie 'XGuardKey'
Parameter 'action' can be:
@cyanide-burnout
cyanide-burnout / Rewind.h
Created June 6, 2018 15:23
Suggestion for Simple Terminal Client protocol
#ifndef REWIND_H
#define REWIND_H
#include <stdint.h>
#include <netinet/in.h>
#ifdef __cplusplus
extern "C"
{
#endif