# [common] is integral section [common] # A literal address or host name for IPv6 must be enclosed # in square brackets, as in"[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80" bind_addr = 0.0.0.0 bind_port = 5443 # udp port used for kcp protocol, it can be same with 'bind_port' # if not set, kcp is disabled in frps kcp_bind_port = 5443 # if you want to configure or reload frps by dashboard, dashboard_port must be set dashboard_port = 8090 # dashboard assets directory(only for debug mode) dashboard_user = admin dashboard_pwd = admin # assets_dir = ./static vhost_http_port = 6080 vhost_https_port = 6443 # console or real logFile path like ./frps.log log_file = ./frps.log # debug, info, warn, error log_level = info log_max_days = 3 # auth token token = Your_Token # It is convenient to use subdomain configure for http、https type when many people use one frps server together. subdomain_host = your.domain # only allow frpc to bind ports you list, if you set nothing, there won't be any limit #allow_ports = 1-65535 # pool_count in each proxy will change to max_pool_count if they exceed the maximum value max_pool_count = 50 # if tcp stream multiplexing is used, default is true tcp_mux = true
defget_ip_address(request): ip = request.META.get('HTTP_X_REAL_IP', "") ifnot ip: ip = request.META.get("HTTP_X_FORWARDED_FOR", "") ifnot ip: ip = request.META.get('REMOTE_ADDR', "") client_ip = ip.split(",")[-1].strip() if ip else"" return client_ip