Ejemplo n.º 1
0
func node_info(par string) {
	v := network.Look4conn(par)
	if v == nil {
		fmt.Println("There is no such an active connection")
	} else {
		fmt.Print(v.Stats())
	}
}
Ejemplo n.º 2
0
func raw_net(w http.ResponseWriter, r *http.Request) {
	if !ipchecker(r) {
		return
	}

	defer func() {
		if r := recover(); r != nil {
			fmt.Fprintln(w, "Error")
		}
	}()

	if len(r.Form["id"]) == 0 {
		fmt.Println("No id given")
		return
	}

	v := network.Look4conn(r.Form["id"][0])
	if v == nil {
		fmt.Fprintln(w, "There is no such an active connection")
	} else {
		w.Write([]byte(v.Stats()))
	}
}