func NewSocket(s Session, h *Handler, connected bool) *Socket {
	return &Socket{
		Session:   s,
		handler:   h,
		connected: connected,
		msgs:      make(chan Event, maxMessageBufferSize),
	}
}
NewSocket creates a new socket.
package live
import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"net/url"
	"sync"
	"golang.org/x/net/html"
	"nhooyr.io/websocket"
)
const (
	maxMessageBufferSize = 16
)
type Socket struct {
	Session Session
	handler       *Handler
	connected     bool
	currentRender *html.Node
	msgs          chan Event
	closeSlow     func()
	data   interface{}
	dataMu sync.Mutex
}