Exemplo n.º 1
0
// Called when package is loaded
func init() {
	// Create root page
	header.AddPage("/", "Home")
	webSocketHandler.AddPage("/", "home")

	// Create the template
	home = template.New("/")
	home, _ = home.Parse(templateSource())
}
Exemplo n.º 2
0
// Initialize the package
func Init(host string, port int, ldebug bool, lssids []string) {
	// Set package variables
	//db = ldb
	debug = ldebug
	ssids = lssids

	header.AddPage("/kismet", "Kismet")
	http.HandleFunc("/kismet", func(w http.ResponseWriter, r *http.Request) {
		HttpKismet(w, r, ssids)
	})

	// Establish connection to kismet server
	golibkismet.Connect(host, port, debug)

	// Listen for responses
	go listen()

	// Setup the client
	setupClient()
}