Peter Kelley
Peter Kelley

Reputation: 2360

How do I connect to a webpack dev server running in codeanywhere

I am having issues connecting to a webpack dev server running in codeanywhere. I have the following in my webpack.config.js:

devServer: {
// "disableHostCheck" added due to issue: https://github.com/webpack/webpack-dev-server/issues/1604
// Fix should be done with: https://github.com/webpack/webpack-dev-server/pull/1608
disableHostCheck: true,
headers: {
  'Access-Control-Allow-Origin': '*'
},
host: '0.0.0.0',
allowedHosts: [
  '.codeanyapp.com'
],
public: 'port-4200.<container-address>.codeanyapp.com'

}

These are the dev server start parameters:

--https --port 4200

I am having no success with either of the following URLs:

http://port-4200.<container-address>.codeanyapp.com/
https://port-4200.<container-address>.codeanyapp.com/

Any ideas what to try next?

Edit: Looks like a https issue, I can get the server talking via http. Any idea what the correct openssl parameters are to generate a self signed certificate that works in chrome?

Upvotes: 0

Views: 396

Answers (1)

Cas
Cas

Reputation: 1

I had the same issue. What fixed it for me was setting the devServer property in webpack.config.js like so:

devServer: {
  host:'0.0.0.0',
  port: 4200,
  contentBase: path.join(__dirname, [your path]),
  watchContentBase: true,
  compress: true,
  disableHostCheck: true
}

Upvotes: 0

Related Questions