Releases: rsms/gotalk
v1.1.4
Very minor update that makes it possible to use a zero Handlers
struct instead of going through the NewHandlers
function. This makes it easier to allocate Handlers for example as part of another, parent struct.
Example:
type MyThing struct {
Gotalk gotalk.Handlers
myOtherThing Thing
}
func main() {
thing := MyThing{}
thing.Gotalk.Handle("foo", ...)
thing.Start()
}
func (m *MyThing) Start() {
gotalk := gotalk.WebSocketHandler()
gotalk.Handlers = &m.Gotalk
}
Prior to v1.1.4 you would have to do something like this instead, allocating a Handlers struct via the NewHandlers function:
type MyThing struct {
Gotalk *gotalk.Handlers
myOtherThing Thing
}
func NewMyThing() *MyThing {
return &MyThing{ Gotalk: gotalk.NewHandlers() }
}
func main() {
thing := NewMyThing()
thing.Gotalk.Handle("foo", ...)
thing.Start()
}
func (m *MyThing) Start() {
gotalk := gotalk.WebSocketHandler()
gotalk.Handlers = &m.Gotalk
}
v1.1.3
Improvements to the JavaScript library
gotalk.defaultResponderAddress
can now be set to a partial URL, like a path or a hostname without protocol. Examples of acceptable values:
ws://host/path
-- fully qualified. What was previously required.//host/path
-- match protocol script is served over (ws for http, wss for https)/path
-- automatic protocol and hostname script is served over/from
A warning message is now printed to the console when gotalk.developmentMode
is true and connection to gotalk websocket server fails, with a helpful message about gotalk.defaultResponderAddress
.
New property gotalk.developmentMode
can be set to true to enable aforementioned warning message. It also enables console.error
calls with full error information for handler exceptions and messaging errors. gotalk.developmentMode
defaults to true when the script is served from localhost, otherwise its value is false by default.
v1.1.2
This release only contains improvements to the built-in JS library:
- New version of JS library itself (see gotalk/js)
- Simplified serving of the js file over HTTP, including some minor performance improvements
- Delivers the js file with gzip compression if the HTTP client accepts it
- No longer includes nor loads the large js.map file into memory
v1.1.1
v1.1.0
- Exposes net.Listener on Server.Listener (previously private)
- Adds ListenTLS and ListenTLSCustom functions for starting servers with TLS
- Adds ConnectTLS and Sock.ConnectTLS functions for connecting with TLS
- Adds Sock.ConnectReader function for connecting over any io.ReadWriteCloser
- Adds Server.EnableUnixSocketGC convenience helper function
- Adds TLSCertPool and TLSAddRootCerts functions for customizing default TLS config
- Semantic change to UNIX socket transport: gotalk no longer installs a signal handler
when listening over a UNIX socket using the functionListen("unix", ...)
.
If you want to retain that functionality, explicitly callServer.EnableUnixSocketGC
on the server returned byListen("unix", ...)
.