package main import ( "net" "fmt" "time" ) const MAGIC = "\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78" func isAlive() bool { conn, err := net.Dial("udp", "h.woozle.org:30919") if err != nil { return false } conn.SetReadDeadline(time.Now().Add(5 * time.Second)) pkt := "\x01" + "\x00\x00\x00\x00MERF" + MAGIC conn.Write([]byte(pkt)) resp := make([]byte, 40) rlen, err := conn.Read(resp) if (err != nil) || (rlen == 0) { return false } return true } func main() { fmt.Println("Content-type: text/html") fmt.Println("") fmt.Println("") fmt.Println("") fmt.Println("") fmt.Println("") fmt.Println("") fmt.Println("Is Ginnie playing Minecraft PE?") fmt.Println("") fmt.Println("

Is Ginnie playing Minecraft PE?

") fmt.Println("

") if isAlive() { fmt.Println("yes") } else { fmt.Println("no") } fmt.Println("

") fmt.Println("

Use the external server h.woozle.org port 30919 to connect

") fmt.Println("") }