<commit_before># pixel

[![Build Status](https://travis-ci.org/hblanks/pixel.svg?branch=master)](https://travis-ci.org/hblanks/pixel)

pixel is a simple server for serving tracking pixels and logging them
to a downstream consumer. For starters, it just logs to UDP syslog
using go's `log/syslog` package.


## Setup

To install for development, just do:

    go install github.com/hblanks/pixel/...

A directory to simplify debian packaging is forthcoming.


## Usage

pixel is configured from the environment. A typical invocation might
be:

    LISTEN_ADDRESS=:8080 pixel


## Quickstart (with nginx)

Configure pixel to run using the supervisor / container of your choice
(runit, upstart, daemontools, docker, etc.)

When paired with nginx, a typical (and verified) nginx configuration
might be:

    http {
        gzip on;
        
        server {
            listen 80 default_server;
            
            location /trk/ {
                proxy_pass http://localhost:8080/;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto "http";
            }
            
            location / {
                // Some other app
                proxy_pass http://localhost:5555/;
                proxy_read_timeout 300;
            }
        }
    }


When paired with syslog-ng (and you'll either be pairing with syslog-ng<commit_msg>README.md: use $scheme for X-Forwarded-Proto<commit_after># pixel

[![Build Status](https://travis-ci.org/hblanks/pixel.svg?branch=master)](https://travis-ci.org/hblanks/pixel)

pixel is a simple server for serving tracking pixels and logging them
to a downstream consumer. For starters, it just logs to UDP syslog
using go's `log/syslog` package.


## Setup

To install for development, just do:

    go install github.com/hblanks/pixel/...

A directory to simplify debian packaging is forthcoming.


## Usage

pixel is configured from the environment. A typical invocation might
be:

    LISTEN_ADDRESS=:8080 pixel


## Quickstart (with nginx)

Configure pixel to run using the supervisor / container of your choice
(runit, upstart, daemontools, docker, etc.)

When paired with nginx, a typical (and verified) nginx configuration
might be:

    http {
        gzip on;
        
        server {
            listen 80 default_server;
            
            location /trk/ {
                proxy_pass http://localhost:8080/;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
            }
            
            location / {
                // Some other app
                proxy_pass http://localhost:5555/;
                proxy_read_timeout 300;
            }
        }
    }


When paired with syslog-ng (and you'll either be pairing with syslog-ng
{'fraction_non_alphanumeric': 0.07869742198100407, 'fraction_numerical': 0.011533242876526458, 'mean_word_length': 2.2054347826086955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3446728', 'n_tokens_mistral': 899, 'n_tokens_neox': 804, 'n_words': 271}