diff --git a/README.md b/README.md index d750a54..f5653f2 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ import ( func main() { client := pusher.NewClient("appId", "key", "secret", false) + // in the case of your need to use custom server endpoint + //client := pusher.NewCustomClient("appId", "key", "secret", "localhost:8080", "http") done := make(chan bool) diff --git a/client.go b/client.go index d055e34..2b4a127 100644 --- a/client.go +++ b/client.go @@ -71,6 +71,16 @@ func NewClient(appid, key, secret string) *Client { } } +func NewCustomClient(appid, key, secret, host, scheme string) *Client { + return &Client{ + appid: appid, + key: key, + secret: secret, + Host: host, + Scheme: scheme, + } +} + func (c *Client) Publish(data, event string, channels ...string) error { timestamp := c.stringTimestamp()