Sunday, 7 May 2017

Webpack https request issue

I am using webpack and node websocket server which set https server together.

but whenever I try https request. It occur below error. WebSocket connection to 'wss://test.somthing.com' failed: HTTP Authentication failed; no valid credentials available

surely I have https certification files and work properly when I only open node server without webpack server.

please give me any idea or solution.

below is webpack.config.js.

var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");

module.exports = {
entry: [
    './src/index.js',
    'webpack-dev-server/client?http://0.0.0.0:3001',
    'webpack/hot/only-dev-server'
],


output: {
    path: '/',
    filename: 'bundle.js'
},

devServer: {
    https:true,
    hot:true,
    inline:true,
    host:'0,0,0,0',
    filename: 'bundle.js',
    publicPath: '/',
    historyApiFallback: true,
    contentBase: './public',
    proxy: {
        "**": "https://test.vivar.com"
    }
},

plugins: [
    new webpack.optimize.OccurrenceOrderPlugin(),
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoEmitOnErrorsPlugin()
],

// ES6 문법과 JSX 문법을 사용한다.
module: {
    loaders: [
        {
            test: /.js$/,
            loaders: ['react-hot-loader', 'babel-loader?' + JSON.stringify({
                cacheDirectory: true,
                presets: ['es2015', 'react']
            })],
            exclude: /node_modules/,
        }
        ,
        {
            test:/\.css/,
            loader: 'style-loader!css-loader?modules'
        }
       /* ,
        {
            test:/\.css/,
            loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' })
        }*/
    ]
}
,
plugins: [
    new ExtractTextPlugin("[name].css")
]

};



via happenask

No comments:

Post a Comment