package main
import (
- "code.octet-stream.net/broadcaster/protocol"
+ "code.octet-stream.net/broadcaster/internal/protocol"
"encoding/json"
"golang.org/x/net/websocket"
"log"
)
func RadioSync(ws *websocket.Conn) {
- log.Println("A websocket connected, I think")
+ log.Println("Radio websocket connected, not yet authenticated")
buf := make([]byte, 16384)
badRead := false
radio = r
log.Println("Radio authenticated:", radio.Name)
isAuthenticated = true
+ commandRouter.AddWebsocket(r.Id, ws)
+ defer commandRouter.RemoveWebsocket(ws)
go KeepFilesUpdated(ws)
go KeepPlaylistsUpdated(ws)