Webpack-dev-server not sending requests to external domain via proxy
<p>I'm trying to use the webpack-dev-server proxy configuration to send api requests to an external domain and I can't seem to get it working. </p>

<p>Here's my config:</p>

<pre><code>var path = require('path')

module.exports = {
    entry: './client/index.js',
    output: {
        filename: 'bundle.js',
        path: path.resolve(__dirname, 'public/assets'),
        publicPath: 'assets'
    },
    devServer: {
        contentBase: 'public',
        proxy:{
            '/api/v1*': {
                target: 'http://laravelandwebpack.demo/',
                secure: false
            }
        }
    }
}
</code></pre>

<p>So, anytime my app makes a request with the uri <code>/api/v1...</code> it should send that request to <code>http://laravelandwebpack.demo</code>. </p>

<p>In my Vue app, I'm using the <code>vue-resource</code> to make the requests and I'm defaulting all requests with the needed uri prefix:</p>

<pre><code>var Vue = require('vue')
Vue.use(require('vue-resource'))

new Vue({
    el: 'body',
    http: {
        root: '/api/v1', // prefix all requests with this
        headers:{
            test: 'testheader'
        }
    },
    ready: function (){
        this.$http({
            url: 'tasks',
            method: 'GET'
        }).then(function (response){
            console.log(response);
        }, function (response){
            console.error(response);
        })
    }
})
</code></pre>

<p>The URL's are being constructed correctly, but they're still pointing to <code>localhost:8080</code> which is the webpack-dev-server:</p>

<p><a href="https://i.stack.imgur.com/5On8d.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5On8d.png" alt="Errant http request"></a></p>

<p>I read and re-read the docs for webpack-dev-server and I can't figure out where I have it set up wrong. Any ideas?</p>