Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 10 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down