{"action":"created","issue":{"url":"https://api.github.com/repos/bhauman/lein-figwheel/issues/166","labels_url":"https://api.github.com/repos/bhauman/lein-figwheel/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/bhauman/lein-figwheel/issues/166/comments","events_url":"https://api.github.com/repos/bhauman/lein-figwheel/issues/166/events","html_url":"https://github.com/bhauman/lein-figwheel/pull/166","id":80276342,"number":166,"title":"Only configure :websocket-url if :websocket-host is provided","user":{"login":"peterschwarz","id":282233,"avatar_url":"https://avatars.githubusercontent.com/u/282233?v=3","gravatar_id":"","url":"https://api.github.com/users/peterschwarz","html_url":"https://github.com/peterschwarz","followers_url":"https://api.github.com/users/peterschwarz/followers","following_url":"https://api.github.com/users/peterschwarz/following{/other_user}","gists_url":"https://api.github.com/users/peterschwarz/gists{/gist_id}","starred_url":"https://api.github.com/users/peterschwarz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterschwarz/subscriptions","organizations_url":"https://api.github.com/users/peterschwarz/orgs","repos_url":"https://api.github.com/users/peterschwarz/repos","events_url":"https://api.github.com/users/peterschwarz/events{/privacy}","received_events_url":"https://api.github.com/users/peterschwarz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-24T21:29:31Z","updated_at":"2015-05-24T23:34:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bhauman/lein-figwheel/pulls/166","html_url":"https://github.com/bhauman/lein-figwheel/pull/166","diff_url":"https://github.com/bhauman/lein-figwheel/pull/166.diff","patch_url":"https://github.com/bhauman/lein-figwheel/pull/166.patch"},"body":"Given that `:websocket-host` defaults to `\"localhost\"`, when connected to a running figwheel instance from an external device (e.g. a tablet or another PC), the `:websocket-url` is configured to `\"ws://localhost:3449/figwheel-ws\"`.  The only way to get this to work is explicitly set the `:websocket-host` at a minimum.  If you're like me, you probably change wi-fi networks frequently, and therefore get assigned IP addresses frequently.  \r\n\r\nLooking at source in the support subproject, `figwheel.client/config-defaults` properly handles creating the websocket url based on the javascript `location.host`.  So, automatically, it will connect to localhost if I've loaded the app via `http://localhost:3449`, or to my ip, if I've gone to `http://<my ip>:3449`.\r\n\r\nLong story short, we don't need to default this when generating the `figwheel/connect.cljs`"},"comment":{"url":"https://api.github.com/repos/bhauman/lein-figwheel/issues/comments/105079594","html_url":"https://github.com/bhauman/lein-figwheel/pull/166#issuecomment-105079594","issue_url":"https://api.github.com/repos/bhauman/lein-figwheel/issues/166","id":105079594,"user":{"login":"bhauman","id":2624,"avatar_url":"https://avatars.githubusercontent.com/u/2624?v=3","gravatar_id":"","url":"https://api.github.com/users/bhauman","html_url":"https://github.com/bhauman","followers_url":"https://api.github.com/users/bhauman/followers","following_url":"https://api.github.com/users/bhauman/following{/other_user}","gists_url":"https://api.github.com/users/bhauman/gists{/gist_id}","starred_url":"https://api.github.com/users/bhauman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhauman/subscriptions","organizations_url":"https://api.github.com/users/bhauman/orgs","repos_url":"https://api.github.com/users/bhauman/repos","events_url":"https://api.github.com/users/bhauman/events{/privacy}","received_events_url":"https://api.github.com/users/bhauman/received_events","type":"User","site_admin":false},"created_at":"2015-05-24T23:34:44Z","updated_at":"2015-05-24T23:34:44Z","body":"Peter I understand your reasoning here.  Having this auto-configuration is handy but only works as long as you are using the figwheel server to serve the assets.\r\n\r\nAnd this is a tough one for me, but I think that having figwheel just work when you are serving your app from another server and even the filesystem by default is a big win. See the Quick Start. \r\n\r\nBut I see this need as well. Maybe there is another configuration parameter to add instead? \r\nOr `:websocket-url-hook \"example.core/websocket-url\"` \r\nOr `:websocket-host :js-client-host`?\r\nI'm going to have to think more on this.\r\n"}}