{"action":"created","issue":{"url":"https://api.github.com/repos/joekarl/go-libapns/issues/15","labels_url":"https://api.github.com/repos/joekarl/go-libapns/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/joekarl/go-libapns/issues/15/comments","events_url":"https://api.github.com/repos/joekarl/go-libapns/issues/15/events","html_url":"https://github.com/joekarl/go-libapns/issues/15","id":64376166,"number":15,"title":"Allow custom socket","user":{"login":"blixt","id":158591,"avatar_url":"https://avatars.githubusercontent.com/u/158591?v=3","gravatar_id":"","url":"https://api.github.com/users/blixt","html_url":"https://github.com/blixt","followers_url":"https://api.github.com/users/blixt/followers","following_url":"https://api.github.com/users/blixt/following{/other_user}","gists_url":"https://api.github.com/users/blixt/gists{/gist_id}","starred_url":"https://api.github.com/users/blixt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blixt/subscriptions","organizations_url":"https://api.github.com/users/blixt/orgs","repos_url":"https://api.github.com/users/blixt/repos","events_url":"https://api.github.com/users/blixt/events{/privacy}","received_events_url":"https://api.github.com/users/blixt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-25T21:23:26Z","updated_at":"2015-03-29T19:23:29Z","closed_at":null,"body":"Currently the function for creating an `APNSConnection` with a custom socket is private (used by the test). This functionality would be useful publicly for sandboxed environments where a different `net.Conn` implementation must be used (e.g., [App Engine's socket module](https://cloud.google.com/appengine/docs/go/sockets/reference))."},"comment":{"url":"https://api.github.com/repos/joekarl/go-libapns/issues/comments/87459811","html_url":"https://github.com/joekarl/go-libapns/issues/15#issuecomment-87459811","issue_url":"https://api.github.com/repos/joekarl/go-libapns/issues/15","id":87459811,"user":{"login":"blixt","id":158591,"avatar_url":"https://avatars.githubusercontent.com/u/158591?v=3","gravatar_id":"","url":"https://api.github.com/users/blixt","html_url":"https://github.com/blixt","followers_url":"https://api.github.com/users/blixt/followers","following_url":"https://api.github.com/users/blixt/following{/other_user}","gists_url":"https://api.github.com/users/blixt/gists{/gist_id}","starred_url":"https://api.github.com/users/blixt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blixt/subscriptions","organizations_url":"https://api.github.com/users/blixt/orgs","repos_url":"https://api.github.com/users/blixt/repos","events_url":"https://api.github.com/users/blixt/events{/privacy}","received_events_url":"https://api.github.com/users/blixt/received_events","type":"User","site_admin":false},"created_at":"2015-03-29T19:23:29Z","updated_at":"2015-03-29T19:23:29Z","body":"@joekarl This looks good to me. Just to confirm, would this be the recommended initialization?\r\n\r\n```go\r\nconfig := &APNSConfig{\r\n    CertificateBytes: certPem,\r\n    KeyBytes: keyPem,\r\n}\r\napns.ApplyConfigDefaults(config)\r\n\r\nconn := apns.SocketAPNSConnection(socket, config)\r\n```\r\n\r\nMy only comment would be that it'd be nice if the only difference between `SocketAPNSConnection` and `NewAPNSConnection` would be the additional `net.Conn` parameter. So either apply config defaults in both functions, or leave it up to the user to do it before both functions. What do you think?"}}