Webpack-dev-server: ngrok

Created on 16 Apr 2015  路  3Comments  路  Source: webpack/webpack-dev-server

Guys,

I'm trying to do ngrok 9090 with webpack-dev-server and it doesn't connect.

package.json

"scripts": {
  "build": "webpack",
  "dev": "webpack-dev-server --devtool eval --progress --colors --hot --content-base build"
}

webpack.config.js

var path = require('path');

module.exports = {
  devServer: {
    host: '0.0.0.0',
    port: 9090
  },
  entry: ['webpack/hot/dev-server', path.resolve(__dirname, 'app/app.js')],
  output: {
    path: path.resolve(__dirname, 'build'),
    filename: 'bundle.js'
  },
  module: {
    ...
  }
};

Am I missing something here?

question

Most helpful comment

I've run into this issue as well and this is how I've gotta around it:

  • Webpack dev server on 0.0.0.0:3000
  • ssl turned on for WDS
$ ngrok tcp 3000

Which will return a URL like: tcp://0.tcp.ngrok.io:48528 -> localhost:3000
In your browser, you should visit: https://0.tcp.ngrok.io:48528

This will not hot reload by default -- you have to update your webpack config to point to ngrok (instead of localhost, etc).

All 3 comments

I've run into this issue as well and this is how I've gotta around it:

  • Webpack dev server on 0.0.0.0:3000
  • ssl turned on for WDS
$ ngrok tcp 3000

Which will return a URL like: tcp://0.tcp.ngrok.io:48528 -> localhost:3000
In your browser, you should visit: https://0.tcp.ngrok.io:48528

This will not hot reload by default -- you have to update your webpack config to point to ngrok (instead of localhost, etc).

@nickpresta thanks!

@nickpresta
@henriquea
hi please send here some example

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antoinerousseau picture antoinerousseau  路  3Comments

da2018 picture da2018  路  3Comments

mrdulin picture mrdulin  路  3Comments

mischkl picture mischkl  路  3Comments

StephanBijzitter picture StephanBijzitter  路  3Comments