-
Notifications
You must be signed in to change notification settings - Fork 758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace localtunnel with ngrok #192
Comments
We don't use that lib. We use https://github.com/defunctzombie/localtunnel - which I've not had any problems with personally and seems to be well supported/maintained. Is this a simple mix-up, or have you had problems with the the BrowserSync tunnel? |
Both I think haha. Naturally I mixed up the two localtunnel repositories, however I am having some trouble with localtunnel on BrowserSync: getting a 502 error after a certain amount of time whilst running node-simplecrawler on the page. Nevermind this issue though. |
@shakyShane localtunnel.me is down most of the time with 502 Bad Gateway error, I think it is a good idea to replace it with ngrok as asap, or browser-sync tunnel functionality won't be usable. Please check this issue localtunnel/server#13 on localtunnel. |
@Code-guru - yeah I agree, localtunnel has become unreliable. |
I'm not able to install rc8, while I'm able to install rc7
I don't know if I should report it here or not? The problem is probably that we're behind a proxy.
|
Passing a plain string to
|
Anybody else running across this issue, try passing the following object to
|
@saschlong As you can probably tell from this thread, I did try to include ngrok - but downloading the binary (it's a Go project) was proving even more unreliable that localtunnel is. Ultimately I cannot compromise install for something not essential to BrowserSync. That being said, you can easily integrate ngrok manually var ngrok = require('ngrok');
var browserSync = require('browser-sync')
browserSync({
server: "./app"
}, function (err, bs) {
ngrok.connect(bs.options.get('port'), function (err, url) {
// https://757c1652.ngrok.com -> 127.0.0.1:8080
});
}); |
Ah, ok. That's a shame. But thanks a lot for the tut :-) |
I'm not following exactly where to use the code from your last post. I'm using the Grunt plugin for browsersync. Should I use your code in my page javascript or in my gruntfile.js? Here is what I have in my grunfile.js:
Here is what I have in my HTML page before
|
Hi @samxi - you've actually demonstrated a deficiency with the grunt plugin - specifically that you cannot provide a callback for when BrowserSync is ready... I'll add this to the list of improvements after which you'll be able to call: browserSync: {
dev: {
bsFiles: {
src : ['text/devTest/portionfix-test/display/control/styles/*.css', 'text/devTest/portionfix-test/display/control/js/*.js']
},
options: {
watchTask: true,
proxy: '127.0.0.1:8888',
callbacks: {
ready: function () {
ngrok.connect(bs.options.get('port'), function (err, url) {
// https://757c1652.ngrok.com -> 127.0.0.1:8080
});
}
}
}
}
} |
Sweet, can't wait for this. If it changes the implementation at all, it might be worth mentioning there is an ngrok grunt plugin https://www.npmjs.com/package/grunt-ngrok |
It wouldn't change the implementation at all - there are lots of use cases for the callback, not just the one we discussed here :) |
Great! Looking forward to that implementation. I've previously used BrowserSync with my local IP but at my job I have issues using that so I've been using ngrok. Thanks for your quick reply and attention! |
@samxi - my previous example will work with latest version, just run npm rm grunt-browser-sync && npm install grunt-browser-sync This will ensure you get the latest version |
@shakyShane Sounds good. I'll give it a shot. Thanks! |
For clarity, I use a custom domain setup in ngrok to test local files on devices (http://sambbdev.ngrok.com). I am trying to get the browserSync grunt task to refresh that custom ngrok domain on devices. I have run My gruntfile.js now contains:
I am getting this error: Should I be using:
I tried adding that in a script tag before |
first run |
If I run I'm sure I'm missing something glaringly obvious here, and if so, any elucidation would be greatly appreciated! I'm not even sure what the expected behavior is. Should the ngrok details print to the terminal along side the
|
@samxi — did you ever get this to work? I have just tried messing around with it again today and still am not able to get ngrok to run from the BS callback. I'd love to know if you had any luck with it. |
@jimlakey – Unfortunately I was not able to get it working. I'm hoping to dig into it again soon to see if I can come up with a solution. If I do I'll post it here. |
Is there any intent to implement this? I've had a lot of luck with ngrok at my workplace and zero luck with localtunnel. |
This issue should reopen or localtunnel has to be removed as an option... |
Through previous testing, ngrok appears to be a lot more reliable than localtunnel. Localtunnel even states that we should use ngrok instead.
The text was updated successfully, but these errors were encountered: