Pusher Channels HTTP API library for Go

Overview

Pusher Channels HTTP Go Library

Build Status Coverage Status GoDoc

The Golang library for interacting with the Pusher Channels HTTP API.

This package lets you trigger events to your client and query the state of your Pusher channels. When used with a server, you can validate Pusher Channels webhooks and authenticate private- or presence- channels.

Register for free at https://pusher.com/channels and use the application credentials within your app as shown below.

Supported Platforms

  • Go - supports Go 1.5 or greater.

Table of Contents

Installation

$ go get github.com/pusher/pusher-http-go

Getting Started

package main

import (
  "github.com/pusher/pusher-http-go"
)

func main(){
    // instantiate a client
    pusherClient := pusher.Client{
        AppID:   "APP_ID",
        Key:     "APP_KEY",
        Secret:  "APP_SECRET",
        Cluster: "APP_CLUSTER",
    }

    data := map[string]string{"message": "hello world"}

    // trigger an event on a channel, along with a data payload
    err := pusherClient.Trigger("my-channel", "my_event", data)

    // All trigger methods return an error object, it's worth at least logging this!
    if err != nil {
        panic(err)
    }
}

Configuration

The easiest way to configure the library is by creating a new Pusher instance:

pusherClient := pusher.Client{
    AppID:   "APP_ID",
    Key:     "APP_KEY",
    Secret:  "APP_SECRET",
    Cluster: "APP_CLUSTER",
}

Additional options

Instantiation From URL

pusherClient := pusher.ClientFromURL("http://<key>:<secret>@api-<cluster>.pusher.com/apps/app_id")

Note: the API URL differs depending on the cluster your app was created in:

http://key:[email protected]/apps/app_id
http://key:[email protected]/apps/app_id

Instantiation From Environment Variable

pusherClient := pusher.ClientFromEnv("PUSHER_URL")

This is particularly relevant if you are using Pusher Channels as a Heroku add-on, which stores credentials in a "PUSHER_URL" environment variable.

HTTPS

To ensure requests occur over HTTPS, set the Secure property of a pusher.Client to true.

pusherClient.Secure = true

This is false by default.

Request Timeouts

If you wish to set a time-limit for each HTTP request, create a http.Client instance with your specified Timeout field and set it as the Pusher Channels instance's Client:

httpClient := &http.Client{Timeout: time.Second * 3}

pusherClient.HTTPClient = httpClient

If you do not specifically set a HTTP client, a default one is created with a timeout of 5 seconds.

Changing Host

Changing the pusher.Client's Host property will make sure requests are sent to your specified host.

pusherClient.Host = "foo.bar.com"

By default, this is "api.pusherapp.com".

Changing the Cluster

Setting the pusher.Client's Cluster property will make sure requests are sent to the cluster where you created your app.

NOTE! If Host is set then Cluster will be ignored.

pusherClient.Cluster = "eu" // in this case requests will be made to api-eu.pusher.com.

End to End Encryption

This library supports end to end encryption of your private channels. This means that only you and your connected clients will be able to read your messages. Pusher cannot decrypt them. You can enable this feature by following these steps:

  1. You should first set up Private channels. This involves creating an authentication endpoint on your server.

  2. Next, generate a 32 byte master encryption key, base64 encode it and store it securely.

    This is secret and you should never share this with anyone. Not even Pusher.

    To generate a suitable key from a secure random source, you could use:

    openssl rand -base64 32
  3. Pass the encoded key when constructing your pusher.Client

    pusherClient := pusher.Client{
        AppID:                    "APP_ID",
        Key:                      "APP_KEY",
        Secret:                   "APP_SECRET",
        Cluster:                  "APP_CLUSTER",
        EncryptionMasterKeyBase64 "<output from command above>",
    }
  4. Channels where you wish to use end to end encryption should be prefixed with private-encrypted-.

  5. Subscribe to these channels in your client, and you're done! You can verify it is working by checking out the debug console on the https://dashboard.pusher.com/ and seeing the scrambled ciphertext.

Important note: This will not encrypt messages on channels that are not prefixed by private-encrypted-.

Google App Engine

As of version 1.0.0, this library is compatible with Google App Engine's urlfetch library. Pass in the HTTP client returned by urlfetch.Client to your Pusher Channels initialization struct.

package helloworldapp

import (
    "appengine"
    "appengine/urlfetch"
    "fmt"
    "github.com/pusher/pusher-http-go"
    "net/http"
)

func init() {
    http.HandleFunc("/", handler)
}

func handler(w http.ResponseWriter, r *http.Request) {
    c := appengine.NewContext(r)
    urlfetchClient := urlfetch.Client(c)

    pusherClient := pusher.Client{
        AppID:      "APP_ID",
        Key:        "APP_KEY",
        Secret:     "APP_SECRET",
        HTTPClient: urlfetchClient,
    }

    pusherClient.Trigger("my-channel", "my_event", map[string]string{"message": "hello world"})

    fmt.Fprint(w, "Hello, world!")
}

Usage

Triggering events

It is possible to trigger an event on one or more channels. Channel names can contain only characters which are alphanumeric, _ or - and have to be at most 200 characters long. Event name can be at most 200 characters long too.

Single channel

func (c *Client) Trigger
Argument Description
channel string The name of the channel you wish to trigger on.
event string The name of the event you wish to trigger
data interface{} The payload you wish to send. Must be marshallable into JSON.
data := map[string]string{"hello": "world"}
pusherClient.Trigger("greeting_channel", "say_hello", data)

Multiple channels

func (c. *Client) TriggerMulti
Argument Description
channels []string A slice of channel names you wish to send an event on. The maximum length is 10.
event string As above.
data interface{} As above.
Example
pusherClient.TriggerMulti([]string{"a_channel", "another_channel"}, "event", data)

Excluding event recipients

func (c *Client) TriggerExclusive and func (c *Client) TriggerMultiExclusive follow the patterns above, except a socket_id is given as the last parameter.

These methods allow you to exclude a recipient whose connection has that socket_id from receiving the event. You can read more here.

Examples

On one channel:

pusherClient.TriggerExclusive("a_channel", "event", data, "123.12")

On multiple channels:

pusherClient.TriggerMultiExclusive([]string{"a_channel", "another_channel"}, "event", data, "123.12")

Batches

func (c. *Client) TriggerBatch
Argument Description
batch []Event A list of events to publish
Example
pusherClient.TriggerBatch([]pusher.Event{
  { Channel: "a_channel", Name: "event", Data: "hello world", nil },
  { Channel: "a_channel", Name: "event", Data: "hi my name is bob", nil },
})

Authenticating Channels

Application security is very important so Pusher Channels provides a mechanism for authenticating a user’s access to a channel at the point of subscription.

This can be used both to restrict access to private channels, and in the case of presence channels notify subscribers of who else is also subscribed via presence events.

This library provides a mechanism for generating an authentication signature to send back to the client and authorize them.

For more information see our docs.

Private channels

func (c *Client) AuthenticatePrivateChannel
Argument Description
params []byte The request body sent by the client
Return Value Description
response []byte The response to send back to the client, carrying an authentication signature
err error Any errors generated
Example
func pusherAuth(res http.ResponseWriter, req *http.Request) {
    params, _ := ioutil.ReadAll(req.Body)
    response, err := pusherClient.AuthenticatePrivateChannel(params)
    if err != nil {
        panic(err)
    }

    fmt.Fprintf(res, string(response))
}

func main() {
    http.HandleFunc("/pusher/auth", pusherAuth)
    http.ListenAndServe(":5000", nil)
}
Example (JSONP)
func pusherJsonpAuth(res http.ResponseWriter, req *http.Request) {
    var (
        callback, params string
    )

    {
        q := r.URL.Query()
        callback = q.Get("callback")
        if callback == "" {
            panic("callback missing")
        }
        q.Del("callback")
        params = []byte(q.Encode())
    }

    response, err := pusherClient.AuthenticatePrivateChannel(params)
    if err != nil {
        panic(err)
    }

    res.Header().Set("Content-Type", "application/javascript; charset=utf-8")
    fmt.Fprintf(res, "%s(%s);", callback, string(response))
}

func main() {
    http.HandleFunc("/pusher/auth", pusherJsonpAuth)
    http.ListenAndServe(":5000", nil)
}

Authenticating presence channels

Using presence channels is similar to private channels, but in order to identify a user, clients are sent a user_id and, optionally, custom data.

func (c *Client) AuthenticatePresenceChannel
Argument Description
params []byte The request body sent by the client
member pusher.MemberData A struct representing what to assign to a channel member, consisting of a UserID and any custom UserInfo. See below
Custom Types

pusher.MemberData

type MemberData struct {
    UserID   string
    UserInfo map[string]string
}
Example
params, _ := ioutil.ReadAll(req.Body)

presenceData := pusher.MemberData{
    UserID: "1",
    UserInfo: map[string]string{
        "twitter": "jamiepatel",
    },
}

response, err := pusherClient.AuthenticatePresenceChannel(params, presenceData)

if err != nil {
    panic(err)
}

fmt.Fprintf(res, response)

Application state

This library allows you to query our API to retrieve information about your application's channels, their individual properties, and, for presence-channels, the users currently subscribed to them.

Get the list of channels in an application

func (c *Client) Channels
Argument Description
additionalQueries map[string]string A map with query options. A key with "filter_by_prefix" will filter the returned channels. To get number of users subscribed to a presence-channel, specify an "info" key with value "user_count".

Pass in nil if you do not wish to specify any query attributes.
Return Value Description
channels *pusher.ChannelsList A struct representing the list of channels. See below.
err error Any errors encountered
Custom Types

pusher.ChannelsList

type ChannelsList struct {
    Channels map[string]ChannelListItem
}

pusher.ChannelsListItem

type ChannelListItem struct {
    UserCount int
}
Example
channelsParams := map[string]string{
    "filter_by_prefix": "presence-",
    "info":             "user_count",
}

channels, err := pusherClient.Channels(channelsParams)

// channels => &{Channels:map[presence-chatroom:{UserCount:4} presence-notifications:{UserCount:31}]}

Get the state of a single channel

func (c *Client) Channel
Argument Description
name string The name of the channel
additionalQueries map[string]string A map with query options. An "info" key can have comma-separated values of "user_count", for presence-channels, and "subscription_count", for all-channels. To use the "subscription_count" value, first check the "Enable subscription counting" checkbox in your App Settings on your Pusher Channels dashboard.

Pass in nil if you do not wish to specify any query attributes.
Return Value Description
channel *pusher.Channel A struct representing a channel. See below.
err error Any errors encountered
Custom Types

pusher.Channel

type Channel struct {
    Name              string
    Occupied          bool
    UserCount         int
    SubscriptionCount int
}
Example
channelParams := map[string]string{
    "info": "user_count,subscription_count",
}

channel, err := pusherClient.Channel("presence-chatroom", channelParams)

// channel => &{Name:presence-chatroom Occupied:true UserCount:42 SubscriptionCount:42}

Get a list of users in a presence channel

func (c *Client) GetChannelUsers
Argument Description
name string The channel name
Return Value Description
users *pusher.Users A struct representing a list of the users subscribed to the presence-channel. See below
err error Any errors encountered.
Custom Types

pusher.Users

type Users struct {
    List []User
}

pusher.User

type User struct {
    ID string
}
Example
users, err := pusherClient.GetChannelUsers("presence-chatroom")

// users => &{List:[{ID:13} {ID:90}]}

Webhook validation

On your dashboard, you can set up webhooks to POST a payload to your server after certain events. Such events include channels being occupied or vacated, members being added or removed in presence-channels, or after client-originated events. For more information see https://pusher.com/docs/webhooks.

This library provides a mechanism for checking that these POST requests are indeed from Pusher, by checking the token and authentication signature in the header of the request.

func (c *Client) Webhook
Argument Description
header http.Header The header of the request to verify
body []byte The body of the request
Return Value Description
webhook *pusher.Webhook If the webhook is valid, this method will return a representation of that webhook that includes its timestamp and associated events. If invalid, this value will be nil.
err error If the webhook is invalid, an error value will be passed.
Custom Types

pusher.Webhook

type Webhook struct {
    TimeMs int
    Events []WebhookEvent
}

pusher.WebhookEvent

type WebhookEvent struct {
    Name     string
    Channel  string
    Event    string
    Data     string
    SocketID string
}
Example
func pusherWebhook(res http.ResponseWriter, req *http.Request) {
    body, _ := ioutil.ReadAll(req.Body)
    webhook, err := pusherClient.Webhook(req.Header, body)
    if err != nil {
        fmt.Println("Webhook is invalid :(")
    } else {
        fmt.Printf("%+v\n", webhook.Events)
    }
}

Feature Support

Feature Supported
Trigger event on single channel
Trigger event on multiple channels
Trigger events in batches
Excluding recipients from events
Authenticating private channels
Authenticating presence channels
Get the list of channels in an application
Get the state of a single channel
Get a list of users in a presence channel
WebHook validation
Heroku add-on support
Debugging & Logging
Cluster configuration
Timeouts
HTTPS
HTTP Proxy configuration
HTTP KeepAlive

Helper Functionality

These are helpers that have been implemented to to ensure interactions with the HTTP API only occur if they will not be rejected e.g. channel naming conventions.

Helper Functionality Supported
Channel name validation
Limit to 10 channels per trigger
Limit event name length to 200 chars

Developing the Library

Feel more than free to fork this repo, improve it in any way you'd prefer, and send us a pull request :)

Running the tests

$ go test

License

This code is free to use under the terms of the MIT license.

Comments
  • Add push notifications

    Add push notifications

    Add push notification feature to the Go library.

    How: Added Client.Notify method and the PushNotification type.

    Ticket: https://pusher2.atlassian.net/browse/PROD-1426

    opened by Charlesworth 15
  • Support fetching channel info on trigger

    Support fetching channel info on trigger

    This PR adds support for an upcoming experimental Channels feature that allows channels attributes being returned as part of a trigger response. These attributes are requested in the same way as the channels GET requests - specifically by specifying an info parameter.

    Note: this PR introduces a breaking change to TriggerBatch, and deprecates TriggerExclusive and TriggerMultiExclusive.

    ~I will leave this in draft form until support has been added to Channels and the API documented.~

    Summary of changes to the API

    // New methods
    
    type TriggerChannelsList struct {
    	Channels map[string]TriggerChannelListItem `json:"channels"`
    }
    
    type TriggerChannelListItem struct {
    	UserCount         *int `json:"user_count,omitempty"`
    	SubscriptionCount *int `json:"subscription_count,omitempty"`
    }
    
    func (c *Client) TriggerWithParams(
    	channel string,
    	eventName string,
    	data interface{},
    	parameters map[string]string,
    ) (*TriggerChannelsList, error)
    
    func (c *Client) TriggerMultiWithParams(
    	channels []string,
    	eventName string,
    	data interface{},
    	parameters map[string]string,
    ) (*TriggerChannelsList, error)
    
    // Deprecated methods:
    
    func (c *Client) TriggerExclusive(channel string, eventName string, data interface{}, socketID string) error
    
    func (c *Client) TriggerMultiExclusive(channels []string, eventName string, data interface{}, socketID string) error
    
    // Modified methods (breaking change)
    
    type Event struct {
    	Channel  string
    	Name     string
    	Data     interface{}
    	SocketID *string
    	Info     *string // New field
    }
    
    func (c *Client) TriggerBatch(batch []Event) (*TriggerChannelsList, error)
    

    For all new methods, if no "info" is specified, then Channels will respond with an empty response {}, this will be returned to the caller of this SDK as TriggerChannelList{Channels: nil}.

    Design decisions

    Non-batch triggering

    Supporting the "info" parameter

    Currently there are 4 methods for triggering events:

    • func (c *Client) Trigger(channel string, eventName string, data interface{}) error
    • func (c *Client) TriggerMulti(channels []string, eventName string, data interface{})
    • func (c *Client) TriggerExclusive(channel string, eventName string, data interface{}, socketID string) error
    • func (c *Client) TriggerMultiExclusive(channels []string, eventName string, data interface{}, socketID string) error

    Rather than adding 4 more methods to add equivalent methods, but with an additional info parameter, I decided to take a more extensible approach like we do for the Channel and Channels methods, where a map[string]string of parameters can be passed in (though I decided to rename this to parameters instead of additionalQueries for consistency with pusher-http-java and pusher-http-dotnet). This means only two new methods need to be added: TriggerWithParams and TriggerMultiWithParams.

    The socket_id can be specified in this parameters map, and therefore the TriggerExclusive and TriggerMultiExclusive can be deprecated.

    An additional advantage of this extensible approach is it means Channels could add support for new parameters and the SDK wouldn't need updating. The downside is the parameters are less discoverable.

    A middle-ground approach could have been to create struct types that define the set of parameters that a function takes. This keeps the advantage that we can keep a single method (avoid a method-per combination of parameters). It also makes invalid parameters impossible to specify, and the parameters would be more discoverable. However it would require library updates in order to support new parameters in the future. I also think we should update the entire library to this pattern if we were going to adopt it anywhere, which implies a significant refactor to the public API and heavy breaking changes. For that reason I chose not to go for this approach.

    Returning the attributes

    Another controversial area was how to model the return value. I decided to define a type that is similar to the ChannelsList type returned by the Channels method. The reason I didn't use the same type was because Channels does not return exactly the same set of required/optional fields for both these methods, and it's possible that the response schema will diverge further over time.

    Another approach could be to return a weakly-typed map[string]interface{} to represent an arbitrary JSON object. This would have the advantage that the SDK would not need to be updated if Channels adds or removes fields from the response. It's also more consistent with pusher-http-java and pusher-http-dotnet. The downside is it would lead to breaking changes to the Channel/Channels if we want to keep the response types consistent (I think we should). It would also mean clients would have to be response for handling invalid responses (missing keys, performing type assertions etc).

    I also don't like the existing ChannelsList name, but I decided to copy the naming convention for the TriggerChannelsList type anyway. The "ChannelsList" actually represents an object that contains a "channels" key whose value is the "channels list" - not the root object. If, in the future, Channels adds new fields to the root object, the name will make even less sense. I think ChannelsBody/TriggerBody would have been better names. I decided against changing this as part of this PR as it would introduce a breaking change to the Channels method.

    Batch triggering

    Supporting the "info" parameter

    The Event type has a new (optional) Info field added.

    The optionality of "info" is modelled as a pointer, in the same way as SocketID. The downside of this is it makes specifying it a bit unergonomic:

    // _Must_ assign the optional value to a variable
    channelInfo := "subscription_count"
    channels, err := client.TriggerBatch([]Event{
        {Channel: "test_channel", Name: "test", Data: "yolo2", Info: &channelInfo},
    })
    

    Returning the attributes (breaking change)

    The method now returns a (*TriggerChannelsList, error), instead of just error.

    The breaking change could have been avoided by leaving the "old" introducing a new method (e.g. TriggerBatchResponse), but I didn't think it was worth the additional complexity in the API.

    Another potentially controversial decision was to re-use the TriggerChannelsList return type that the Trigger*WithParams methods return. This is ok for now when the responses are identical, but in the future it's feasible that Channels might return different different responses for each of these endpoints. The library would require a breaking change if this was ever done. I think thats worth risking in order to keep things simpler for now.

    TODO

    • [x] mark the Info field on Trigger methods experimental
    • [x] https://pusher.com/docs
    opened by WillSewell 9
  • What about Receiving Pusher events

    What about Receiving Pusher events

    hi, I also like to be able to receive pusher events in my golang app (ie. just like the Browser client). Is that possible with this lib?

    thanks, eddie

    opened by maded2 9
  • Introducing Breaking Changes

    Introducing Breaking Changes

    You changed AppId to AppID and also UserId to UserID and it took me hours to figure out why my deployments weren't working. Come on guys lets not introduce breaking changes like this without some sort of heads up!

    opened by Fyb3roptik 5
  • Suggestion: expose function to manually pass channel name and socket ID for authentication

    Suggestion: expose function to manually pass channel name and socket ID for authentication

    If I'm correct, AuthenticatePrivateChannel is the only way to compute the auth token.

    Other official libraries, include something like:

    var auth = pusher.authenticate(socketId, channel);
    

    See: https://github.com/pusher/pusher-http-node#authenticating-private-channels

    Right now, if I want to perform some basic checks on the channel name, I need to replicate the byte parsing logic that AuthenticatePrivateChannel does internally in https://github.com/pusher/pusher-http-go/blob/61fc56dfae01b9f01fa4e5c4cf60ba89e306c9f4/util.go#L20

    enhancement wontfix 
    opened by philippfrank 4
  • Current design doesn't allow switching the http client

    Current design doesn't allow switching the http client

    Some environments doesn't support the default http client (like Google App Engine). Current design makes it difficult to switch out the http client.

    The workaround is currently to switch only the underlying transport if this is enough by: client.HttpClient().Transport = urlfetch.Client(c).Transport

    This is related to: https://github.com/pusher/pusher-http-go/issues/5

    opened by wingedkiwi 4
  • timeouts

    timeouts

    Hello, I've got the following quite often:

    request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
    

    Where timeout could come from?

    thank you

    opened by jney 3
  • Refactor TriggerBatch's Event.Data string -> interface

    Refactor TriggerBatch's Event.Data string -> interface

    It refactors TriggerBatch's API by modifying the accepted type Event.Data to be consistent with the Trigger's API.

    This is obtained by switching from a string type to a interface{} type. This approach, in fact, allows any matching type to be passed in as a Payload, which is desirable as we do not want to limit the users to strings only.

    opened by damdo 3
  • Add End-to-end encryption for TriggerBatch

    Add End-to-end encryption for TriggerBatch

    • It adds missing End-to-end encryption support for TriggerBatch
    • it adds small refactors and moves hardcoded values into easy modifiable constants
    • It updates the max number of triggerable channels from 10 to 100 (as per official documentation of Pusher)
    opened by damdo 3
  • Share an http.Client between requests

    Share an http.Client between requests

    Allows to use http KeepAlive or pipelining and also configure the transport. client.Timeout is copies to the http.Client on each request if it has changed. It's not ideal but it keeps backward-compatibility.

    Closes #1

    opened by zimbatm 3
  • Enabling client mocks for testing purposes

    Enabling client mocks for testing purposes

    Hello there!

    I noticed that currently the client cannot be mocked for testing purposes. Since my tests should not communicate with any 3rd party I added an interface so the client can be mocked. Additional the constructor can simplify the usage.

    Best, Filikos

    wontfix 
    opened by filikos 2
Releases(v5.0.0)
  • v5.0.0(Feb 19, 2021)

    • Breaking change: TriggerBatch now returns (*TriggerBatchChannelsList, error) instead of error
    • Breaking change: Channels takes ChannelsParams as a parameter instead of map[string]string
    • Breaking change: Channel takes ChannelParams as a parameter instead of map[string]string
    • Breaking change: switches to go modules using option 1. described in https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher - this will cause problems for legacy package managers like dep
    • Added TriggerWithParams and TriggerMultiWithParams - they provide support for requesting channel attributes by specifying an Info field
    • Added a Info field to the Event type passed to TriggerBatch
    • Deprecated TriggerExclusive and TriggerMultiExclusive (use TriggerWithParams and TriggerMultiWithParams instead)
    Source code(tar.gz)
    Source code(zip)
  • v4.0.4(Sep 2, 2020)

  • v4.0.3(Jul 28, 2020)

  • v4.0.2(Jul 28, 2020)

    • Added go.mod for managing the library as a Go module
    • Changed github.com/stretchr/testify/assert with a stable gopkg.in/stretchr/testify.v1/assert
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(May 31, 2019)

    • This release modifies the entire repo to respect the Go Linter. This is a significant API breaking change and will require you to correct references to the names that were changed in your code. All future releases will respect the linter. A summary of the changes:
    • Rename AppId > AppID
    • Rename UserId > UserID
    • Rename SocketId > SocketID
    • Rename Id > ID
    • Rename HttpClient > HTTPClient
    • Improved comments and tabbing
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(May 31, 2019)

    • This release removes the *BufferedEvents return from calls to trigger is it never did anything. Our documentation elsewhere conflicted with this, and it made the library more complex than it needed to be, so we removed it.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(May 31, 2019)

    • This release removes Push Notifications from this library. They can now be found in our new, improved Push Notifications product, Beams! See https://pusher.com/beams for more info.
    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Aug 13, 2018)

  • v1.0.0(May 14, 2015)

    This library has changed the way in which the underlying HTTP client is configured. An example of how to configure it can be found here.

    Instances of http.Client can be passed to the Pusher initializer, meaning this library is now compatible with Google App Engine and its urlfetch library.

    Source code(tar.gz)
    Source code(zip)
  • 0.2.2(May 12, 2015)

  • 0.2.1(Apr 30, 2015)

  • 0.2.0(Mar 30, 2015)

    • A HTTP client is shared between requests to allow configuration. If none is set by the user, the library supplies a default. Allows for pipelining or to change the transport.
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Mar 26, 2015)

    Initial release of the Pusher Go HTTP library.

    *Instantiation of client from credentials, URL or environment variables.

    • User can trigger Pusher events on single channels, multiple channels, and exclude recipients
    • Authentication of private and presence channels
    • Pusher webhook validation
    • Querying application state
    • Cluster configuration, HTTPS support, timeout configuration.
    Source code(tar.gz)
    Source code(zip)
Owner
Pusher
Pusher makes communication and collaboration APIs that power apps all over the world supported by easy to integrate SDKs for web, mobile, and backend.
Pusher
A little library for turning TCP connections into go channels.

netutils By Tim Henderson ([email protected]) This is a little library that was part of a larger project that I decided to pull out and make public.

Tim Henderson 11 Aug 13, 2020
Guilherme Biff Zarelli 3 Jun 6, 2022
List of youtube live channels videos

LIVE Youtube has a bug in their playlist feature when adding a live channel video to it. The channel live will stop at some point of time and the live

Emad Elsaid 4 Dec 25, 2021
Chat app that allows you to group multiple channels into one view.

hashchat Backend service Getting Started Essential steps to get your backend service deployed A helloworld example has been shipped with the template

Commit App Playground 0 Dec 13, 2021
v2 of the veai listener. Now with channels!

veai-listener This is a pipeline tool to allow for watching a dir that takes in video that needs to be upscaled. The dir is accessed via Dropbox and i

Brendan P. 0 Dec 8, 2021
Gogrok is a self hosted, easy to use alternative to ngrok. It uses SSH as a base protocol, using channels and existing functionality to tunnel requests to an endpoint.

gogrok A simple, easy to use ngrok alternative (self hosted!) The server and client can also be easily embedded into your applications, see the 'serve

Tyler Stuyfzand 5 Jun 15, 2022
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http

fasthttp Fast HTTP implementation for Go. Currently fasthttp is successfully used by VertaMedia in a production serving up to 200K rps from more than

Aliaksandr Valialkin 18.5k Sep 28, 2022
Go HTTP tunnel is a reverse tunnel based on HTTP/2.

Go HTTP tunnel is a reverse tunnel based on HTTP/2. It enables you to share your localhost when you don't have a public IP.

Michal Jan Matczuk 2.9k Sep 25, 2022
Simple GUI to convert Charles headers to golang's default http client (net/http)

Charles-to-Go Simple GUI to convert Charles headers to golang's default http client (net/http) Usage Compile code to a binary, go build -ldflags -H=wi

null 0 Dec 14, 2021
Go-http-sleep: Delayed response http server, useful for testing various timeout issue for application running behind proxy

delayed response http server, useful for testing various timeout issue for application running behind proxy

guessi 0 Jan 22, 2022
Http-logging-proxy - A HTTP Logging Proxy For Golang

http-logging-proxy HTTP Logging Proxy Description This project builds a simple r

null 3 Aug 1, 2022
Http-recorder - Application for record http response as static files

http-recorder This is a application for record http response as static files. Th

null 1 Mar 21, 2022
Http-server - A HTTP server and can be accessed via TLS and non-TLS mode

Application server.go runs a HTTP/HTTPS server on the port 9090. It gives you 4

Vedant Pareek 0 Feb 3, 2022
Drop-in replacement for Go net/http when running in AWS Lambda & API Gateway

Package gateway provides a drop-in replacement for net/http's ListenAndServe for use in AWS Lambda & API Gateway, simply swap it out for gateway.Liste

Apex 636 Sep 24, 2022
Small wrapper for containers/image which exposes a HTTP API to fetch

CLI to expose containers/image fetching via HTTP This is a small CLI program which vendors the containers/image Go library and exposes a HTTP API to f

Colin Walters 2 Nov 1, 2021
viagh.NewHTTPClient returns a *http.Client that makes API requests via the gh command.

viagh viagh.NewHTTPClient returns a *http.Client that makes API requests via the gh command. Why viagh? When writing a GitHub CLI extension, the exten

Ken’ichiro Oyama 1 Dec 24, 2021
HTTP API for a DeSo node

About DeSo DeSo is a blockchain built from the ground up to support a fully-featured social network. Its architecture is similar to Bitcoin, only it s

DeSo Protocol 113 Sep 20, 2022
Transparent TLS and HTTP proxy serve and operate on all 65535 ports, with domain regex whitelist and rest api control

goshkan Transparent TLS and HTTP proxy serve & operating on all 65535 ports, with domain regex whitelist and rest api control tls and http on same por

Sina Ghaderi 10 Sep 7, 2022