//runWebsocket with defined port or look for free port if taken
runWebsocket with defined port or look for free port if taken
// runWebsocket with defined port or look for free port if taken
func (gbw *BrowserWindow) runWebsocket() {
	var err error
	errz.Recover(&err)
	listener, err := net.Listen("tcp", ":"+strconv.Itoa(gbw.Port))
	errz.Fatal(err)
	logger.Debug().Msgf("Using port: %d", listener.Addr().(*net.TCPAddr).Port)
	gbw.Port = listener.Addr().(*net.TCPAddr).Port
	http.HandleFunc("/browser/window/events", gbw.mainEventSocket)
	http.HandleFunc("/web/app/events", gbw.onSocket)
	go http.Serve(listener, nil) 
}
func ( gbw * BrowserWindow ) runWebsocket ( ) { var err error errz . Recover ( & err ) listener , err := net . Listen ( " " , " " + strconv . Itoa ( gbw . Port ) ) errz . Fatal ( err ) logger . Debug ( ) . Msgf ( " " , listener . Addr ( ) . ( * net . TCPAddr ) . Port ) gbw . Port = listener . Addr ( ) . ( * net . TCPAddr ) . Port http . HandleFunc ( " " , gbw . mainEventSocket ) http . HandleFunc ( " " , gbw . onSocket ) go http . Serve ( listener , nil ) }
runWebsocket with defined port or look for free port if taken
runWebsocket with defined port or look for free port if taken
// Endpoint for Electron startup/teardown // + browser window events to nodejs // Endpoint for ipc like messages // send from user web application // Start websockets in goroutine