<commit_before>// <NAME> 2014
// Client IP Lookup
// lookup <PORT>

package main

import (
    "fmt"
    "net/http"
    "os"
    "strings"
)

type IpPong struct {}

func (ipPong IpPong) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    ipAddress := r.Header.Get("X-Real-IP")
    if ipAddress == "" {
        ipAddress = strings.Split(r.RemoteAddr, ":")[0]
    }
    fmt.Fprintf(w, "%s\n", ipAddress)
}

func readPort(args []string) string {
    port := "5000"
    if len(args) > 1 {
        port = args[1]
    }
    fmt.Printf("Starting server on port %s\n", port)
    return port
}

func main() {
    var ipResponse IpPong
    port := readPort(os.Args)
    serve := "localhost:" + port
    http.ListenAndServe(serve, ipResponse)
}<commit_msg>Replaced localhost with 0.0.0.0<commit_after>// <NAME> 2014
// Client IP Lookup
// lookup <PORT>

package main

import (
    "fmt"
    "net/http"
    "os"
    "strings"
)

type IpPong struct {}

func (ipPong IpPong) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    ipAddress := r.Header.Get("X-Real-IP")
    if ipAddress == "" {
        ipAddress = strings.Split(r.RemoteAddr, ":")[0]
    }
    fmt.Fprintf(w, "%s\n", ipAddress)
}

func readPort(args []string) string {
    port := "5000"
    if len(args) > 1 {
        port = args[1]
    }
    fmt.Printf("Starting server on port %s\n", port)
    return port
}

func main() {
    var ipResponse IpPong
    port := readPort(os.Args)
    serve := "0.0.0.0:" + port
    http.ListenAndServe(serve, ipResponse)
}
{'fraction_non_alphanumeric': 0.15852047556142668, 'fraction_numerical': 0.019815059445178335, 'mean_word_length': 2.6771844660194173, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2420317', 'n_tokens_mistral': 588, 'n_tokens_neox': 565, 'n_words': 135}