# Path: ccvpn/common.py
# def get_client_ip(request):
#     header_name = settings.REAL_IP_HEADER_NAME
# 
#     if header_name:
#         header_name = header_name.replace('-', '_').upper()
#         value = request.META.get('HTTP_' + header_name)
#         if value:
#             return value.split(',', 1)[0]
# 
#     return request.META.get('REMOTE_ADDR')
# 
# Path: lambdainst/core.py
# def is_vpn_gateway(ip):
#     addresses = get_gateway_exit_ips()
#     return ip in addresses


from django.conf import settings
from ccvpn.common import get_client_ip
from lambdainst.core import is_vpn_gateway


def some_settings(request):
    client_ip = get_client_ip(request)
    return {
        'CLIENT_IP': client_ip,

# Path: ccvpn/common.py
# def get_client_ip(request):
#     header_name = settings.REAL_IP_HEADER_NAME
# 
#     if header_name:
#         header_name = header_name.replace('-', '_').upper()
#         value = request.META.get('HTTP_' + header_name)
#         if value:
#             return value.split(',', 1)[0]
# 
#     return request.META.get('REMOTE_ADDR')
# 
# Path: lambdainst/core.py
# def is_vpn_gateway(ip):
#     addresses = get_gateway_exit_ips()
#     return ip in addresses


# Path: ccvpn/context_processors.py
from django.conf import settings
from ccvpn.common import get_client_ip
from lambdainst.core import is_vpn_gateway



def some_settings(request):
    client_ip = get_client_ip(request)
    return {
        'CLIENT_IP': client_ip,

        'CLIENT_ON_VPN': is_vpn_gateway(client_ip),