{"action":"created","comment":{"url":"https://api.github.com/repos/getlantern/flashlight-build/pulls/comments/25127475","id":25127475,"diff_hunk":"@@ -14,9 +18,22 @@ func (client *Client) initBalancer(cfg *ClientConfig) *balancer.Balancer {\n \tdialers := make([]*balancer.Dialer, 0, len(cfg.FrontedServers)+len(cfg.ChainedServers))\n \n \tlog.Debugf(\"Adding %d domain fronted servers\", len(cfg.FrontedServers))\n+\tvar highestQOSFrontedDialer fronted.Dialer\n+\thighestQOS := math.MinInt32\n \tfor _, s := range cfg.FrontedServers {\n-\t\tdialer := s.dialer(cfg.MasqueradeSets)\n+\t\tfd, dialer := s.dialer(cfg.MasqueradeSets)\n \t\tdialers = append(dialers, dialer)\n+\t\tif dialer.QOS > highestQOS {\n+\t\t\thighestQOSFrontedDialer = fd\n+\t\t}\n+\t}\n+\n+\tif highestQOSFrontedDialer != nil {\n+\t\t// This function will configure the HTTP client the geo package is going to\n+\t\t// use.\n+\t\tgeolookup.SetHTTPClient(highestQOSFrontedDialer.DirectHttpClient())\n+\t} else {\n+\t\tlog.Debugf(\"No fronted dialers found, unable to look up public ip\")","path":"src/github.com/getlantern/flashlight/client/balancer.go","position":32,"original_position":32,"commit_id":"39941d14b493f7d001e4efd8d722205d3b1dd9dc","original_commit_id":"39941d14b493f7d001e4efd8d722205d3b1dd9dc","user":{"login":"oxtoacart","id":5000654,"avatar_url":"https://avatars.githubusercontent.com/u/5000654?v=3","gravatar_id":"","url":"https://api.github.com/users/oxtoacart","html_url":"https://github.com/oxtoacart","followers_url":"https://api.github.com/users/oxtoacart/followers","following_url":"https://api.github.com/users/oxtoacart/following{/other_user}","gists_url":"https://api.github.com/users/oxtoacart/gists{/gist_id}","starred_url":"https://api.github.com/users/oxtoacart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxtoacart/subscriptions","organizations_url":"https://api.github.com/users/oxtoacart/orgs","repos_url":"https://api.github.com/users/oxtoacart/repos","events_url":"https://api.github.com/users/oxtoacart/events{/privacy}","received_events_url":"https://api.github.com/users/oxtoacart/received_events","type":"User","site_admin":false},"body":"Maybe error instead of debug?","created_at":"2015-02-22T00:29:33Z","updated_at":"2015-02-22T00:29:33Z","html_url":"https://github.com/getlantern/flashlight-build/pull/82#discussion_r25127475","pull_request_url":"https://api.github.com/repos/getlantern/flashlight-build/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/getlantern/flashlight-build/pulls/comments/25127475"},"html":{"href":"https://github.com/getlantern/flashlight-build/pull/82#discussion_r25127475"},"pull_request":{"href":"https://api.github.com/repos/getlantern/flashlight-build/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/getlantern/flashlight-build/pulls/82","id":29757298,"html_url":"https://github.com/getlantern/flashlight-build/pull/82","diff_url":"https://github.com/getlantern/flashlight-build/pull/82.diff","patch_url":"https://github.com/getlantern/flashlight-build/pull/82.patch","issue_url":"https://api.github.com/repos/getlantern/flashlight-build/issues/82","number":82,"state":"open","locked":false,"title":"Ability to send/receive different t messages over a single websocket channel and user's geolocation data lookup","user":{"login":"xiam","id":385670,"avatar_url":"https://avatars.githubusercontent.com/u/385670?v=3","gravatar_id":"","url":"https://api.github.com/users/xiam","html_url":"https://github.com/xiam","followers_url":"https://api.github.com/users/xiam/followers","following_url":"https://api.github.com/users/xiam/following{/other_user}","gists_url":"https://api.github.com/users/xiam/gists{/gist_id}","starred_url":"https://api.github.com/users/xiam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiam/subscriptions","organizations_url":"https://api.github.com/users/xiam/orgs","repos_url":"https://api.github.com/users/xiam/repos","events_url":"https://api.github.com/users/xiam/events{/privacy}","received_events_url":"https://api.github.com/users/xiam/received_events","type":"User","site_admin":false},"body":"Hello @oxtoacart, @atavism,\r\n\r\nMy [former PR](https://github.com/getlantern/flashlight-build/pull/80) was apparently polluted with other stuff so I closed it and integrated my changes again on a fresh copy of the valencia branch.\r\n\r\nFollowing our discussion on sending different message types over the same channel I've modified your `flashlight/ui/` and `flashlight/proxiedsites` packages, services like `proxiedsites` will need to [register themselves][1] using `ui.Register()` and send messages using an [envelope][2].\r\n\r\nThe client will also need to send messages in the same envelope and they can be read [almost in the same fashion][3] that they were read before.\r\n\r\nLantern-UI was also updated: I added a [new service][4] that provides a map of callbacks associated to message types and also a new [DataSource][5] factory which is now used by [ProxiedSites][6] to communicate with the /data channel.\r\n\r\nThis PR also contains code for closing https://github.com/getlantern/lantern/issues/2213, the UI is now receiving geolocation information and printing it to the debug output:\r\n\r\n![screenshot from 2015-02-21 08 23 09](https://cloud.githubusercontent.com/assets/385670/6314468/c3867212-b9a5-11e4-831d-1f4f535c4730.png)\r\n\r\nThis includes changes to both Go and Javascript code so I think it would be better is you both could help me reviewing it.\r\n\r\nThanks!\r\n\r\n[1]: https://github.com/getlantern/flashlight-build/blob/b3960a1698af7be13df60334e1f0d2a0041e1d9c/src/github.com/getlantern/flashlight/proxiedsites/proxiedsites.go#L80\r\n[2]: https://github.com/getlantern/flashlight-build/blob/b3960a1698af7be13df60334e1f0d2a0041e1d9c/src/github.com/getlantern/flashlight/proxiedsites/proxiedsites.go#L66\r\n[3]: https://github.com/getlantern/flashlight-build/blob/b3960a1698af7be13df60334e1f0d2a0041e1d9c/src/github.com/getlantern/flashlight/proxiedsites/proxiedsites.go#L95\r\n[4]: https://github.com/getlantern/flashlight-build/blob/ed80c984e5f8eee35e837a0d11e3f9558a26aa33/src/github.com/getlantern/lantern-ui/app/js/services.js#L6\r\n[5]: https://github.com/getlantern/flashlight-build/blob/b3960a1698af7be13df60334e1f0d2a0041e1d9c/src/github.com/getlantern/lantern-ui/app/js/app.js#L74\r\n[6]: https://github.com/getlantern/flashlight-build/blob/b3960a1698af7be13df60334e1f0d2a0041e1d9c/src/github.com/getlantern/lantern-ui/app/js/app.js#L131\r\n","created_at":"2015-02-21T18:12:34Z","updated_at":"2015-02-22T00:29:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63fbb58e24b6c43720c0b5659c5b72ba5a167b89","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/getlantern/flashlight-build/pulls/82/commits","review_comments_url":"https://api.github.com/repos/getlantern/flashlight-build/pulls/82/comments","review_comment_url":"https://api.github.com/repos/getlantern/flashlight-build/pulls/comments/{number}","comments_url":"https://api.github.com/repos/getlantern/flashlight-build/issues/82/comments","statuses_url":"https://api.github.com/repos/getlantern/flashlight-build/statuses/39941d14b493f7d001e4efd8d722205d3b1dd9dc","head":{"label":"getlantern:issue-2213-2","ref":"issue-2213-2","sha":"39941d14b493f7d001e4efd8d722205d3b1dd9dc","user":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"repo":{"id":27652771,"name":"flashlight-build","full_name":"getlantern/flashlight-build","owner":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getlantern/flashlight-build","description":"Repeatable builds for flashlight, using gox","fork":false,"url":"https://api.github.com/repos/getlantern/flashlight-build","forks_url":"https://api.github.com/repos/getlantern/flashlight-build/forks","keys_url":"https://api.github.com/repos/getlantern/flashlight-build/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getlantern/flashlight-build/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getlantern/flashlight-build/teams","hooks_url":"https://api.github.com/repos/getlantern/flashlight-build/hooks","issue_events_url":"https://api.github.com/repos/getlantern/flashlight-build/issues/events{/number}","events_url":"https://api.github.com/repos/getlantern/flashlight-build/events","assignees_url":"https://api.github.com/repos/getlantern/flashlight-build/assignees{/user}","branches_url":"https://api.github.com/repos/getlantern/flashlight-build/branches{/branch}","tags_url":"https://api.github.com/repos/getlantern/flashlight-build/tags","blobs_url":"https://api.github.com/repos/getlantern/flashlight-build/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getlantern/flashlight-build/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getlantern/flashlight-build/git/refs{/sha}","trees_url":"https://api.github.com/repos/getlantern/flashlight-build/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getlantern/flashlight-build/statuses/{sha}","languages_url":"https://api.github.com/repos/getlantern/flashlight-build/languages","stargazers_url":"https://api.github.com/repos/getlantern/flashlight-build/stargazers","contributors_url":"https://api.github.com/repos/getlantern/flashlight-build/contributors","subscribers_url":"https://api.github.com/repos/getlantern/flashlight-build/subscribers","subscription_url":"https://api.github.com/repos/getlantern/flashlight-build/subscription","commits_url":"https://api.github.com/repos/getlantern/flashlight-build/commits{/sha}","git_commits_url":"https://api.github.com/repos/getlantern/flashlight-build/git/commits{/sha}","comments_url":"https://api.github.com/repos/getlantern/flashlight-build/comments{/number}","issue_comment_url":"https://api.github.com/repos/getlantern/flashlight-build/issues/comments{/number}","contents_url":"https://api.github.com/repos/getlantern/flashlight-build/contents/{+path}","compare_url":"https://api.github.com/repos/getlantern/flashlight-build/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getlantern/flashlight-build/merges","archive_url":"https://api.github.com/repos/getlantern/flashlight-build/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getlantern/flashlight-build/downloads","issues_url":"https://api.github.com/repos/getlantern/flashlight-build/issues{/number}","pulls_url":"https://api.github.com/repos/getlantern/flashlight-build/pulls{/number}","milestones_url":"https://api.github.com/repos/getlantern/flashlight-build/milestones{/number}","notifications_url":"https://api.github.com/repos/getlantern/flashlight-build/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getlantern/flashlight-build/labels{/name}","releases_url":"https://api.github.com/repos/getlantern/flashlight-build/releases{/id}","created_at":"2014-12-06T23:27:18Z","updated_at":"2015-02-20T16:58:08Z","pushed_at":"2015-02-21T21:41:53Z","git_url":"git://github.com/getlantern/flashlight-build.git","ssh_url":"git@github.com:getlantern/flashlight-build.git","clone_url":"https://github.com/getlantern/flashlight-build.git","svn_url":"https://github.com/getlantern/flashlight-build","homepage":"","size":170733,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"devel"}},"base":{"label":"getlantern:valencia","ref":"valencia","sha":"cbcc8f4db15f0eb8eac773816c9ca52594370221","user":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"repo":{"id":27652771,"name":"flashlight-build","full_name":"getlantern/flashlight-build","owner":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getlantern/flashlight-build","description":"Repeatable builds for flashlight, using gox","fork":false,"url":"https://api.github.com/repos/getlantern/flashlight-build","forks_url":"https://api.github.com/repos/getlantern/flashlight-build/forks","keys_url":"https://api.github.com/repos/getlantern/flashlight-build/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getlantern/flashlight-build/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getlantern/flashlight-build/teams","hooks_url":"https://api.github.com/repos/getlantern/flashlight-build/hooks","issue_events_url":"https://api.github.com/repos/getlantern/flashlight-build/issues/events{/number}","events_url":"https://api.github.com/repos/getlantern/flashlight-build/events","assignees_url":"https://api.github.com/repos/getlantern/flashlight-build/assignees{/user}","branches_url":"https://api.github.com/repos/getlantern/flashlight-build/branches{/branch}","tags_url":"https://api.github.com/repos/getlantern/flashlight-build/tags","blobs_url":"https://api.github.com/repos/getlantern/flashlight-build/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getlantern/flashlight-build/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getlantern/flashlight-build/git/refs{/sha}","trees_url":"https://api.github.com/repos/getlantern/flashlight-build/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getlantern/flashlight-build/statuses/{sha}","languages_url":"https://api.github.com/repos/getlantern/flashlight-build/languages","stargazers_url":"https://api.github.com/repos/getlantern/flashlight-build/stargazers","contributors_url":"https://api.github.com/repos/getlantern/flashlight-build/contributors","subscribers_url":"https://api.github.com/repos/getlantern/flashlight-build/subscribers","subscription_url":"https://api.github.com/repos/getlantern/flashlight-build/subscription","commits_url":"https://api.github.com/repos/getlantern/flashlight-build/commits{/sha}","git_commits_url":"https://api.github.com/repos/getlantern/flashlight-build/git/commits{/sha}","comments_url":"https://api.github.com/repos/getlantern/flashlight-build/comments{/number}","issue_comment_url":"https://api.github.com/repos/getlantern/flashlight-build/issues/comments{/number}","contents_url":"https://api.github.com/repos/getlantern/flashlight-build/contents/{+path}","compare_url":"https://api.github.com/repos/getlantern/flashlight-build/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getlantern/flashlight-build/merges","archive_url":"https://api.github.com/repos/getlantern/flashlight-build/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getlantern/flashlight-build/downloads","issues_url":"https://api.github.com/repos/getlantern/flashlight-build/issues{/number}","pulls_url":"https://api.github.com/repos/getlantern/flashlight-build/pulls{/number}","milestones_url":"https://api.github.com/repos/getlantern/flashlight-build/milestones{/number}","notifications_url":"https://api.github.com/repos/getlantern/flashlight-build/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getlantern/flashlight-build/labels{/name}","releases_url":"https://api.github.com/repos/getlantern/flashlight-build/releases{/id}","created_at":"2014-12-06T23:27:18Z","updated_at":"2015-02-20T16:58:08Z","pushed_at":"2015-02-21T21:41:53Z","git_url":"git://github.com/getlantern/flashlight-build.git","ssh_url":"git@github.com:getlantern/flashlight-build.git","clone_url":"https://github.com/getlantern/flashlight-build.git","svn_url":"https://github.com/getlantern/flashlight-build","homepage":"","size":170733,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/getlantern/flashlight-build/pulls/82"},"html":{"href":"https://github.com/getlantern/flashlight-build/pull/82"},"issue":{"href":"https://api.github.com/repos/getlantern/flashlight-build/issues/82"},"comments":{"href":"https://api.github.com/repos/getlantern/flashlight-build/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/getlantern/flashlight-build/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/getlantern/flashlight-build/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/getlantern/flashlight-build/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/getlantern/flashlight-build/statuses/39941d14b493f7d001e4efd8d722205d3b1dd9dc"}}}}