"An unknown error occurred." appears when I try to log into Craft's admin using browsersync's proxy mode I've stumbled upon a weird thing.

When I run browsersync as browser-sync start -p localhost:8000 and try to log into Craft's admin at localhost:3000/admin I get the message "An unknown error occurred."

If I enter the wrong password, nothing at all appears nor happens. 

This can be worked around by logging in once at localhost:8000/admin, and then accessing the proxied version after... But I'd be sweet if I could login through the proxied version :)

Any suggestions on how this can be resolved?

Here's the log generated once I've deleted all the contents of the logs and then press the login button: http://pastebin.com/3LjbQLj0
Forgot about this question!
I've since solved it by using a different approach.

Now I'm injecting the broser-sync script via its config, avoiding injection if the url is '/admin/', and redirecting to :8000 if '/admin/' is visited from :3000

Here's my whole working browser-sync.js config file, for those few other souls searching for something similar: 

Note: I'm auto-injecting the webpack dev build with this config as well.

const sync = 3000
const script = 'browser-sync-client.js'

const php = 8000
const webpack = 1337
const adminPath = '/admin/'
const address = require('ip').address()



module.exports = {
    port: sync,
    proxy: {target: `${address}:${php}`},

    files: [
        'source/layout.twig',
        'source/pages/*.twig',
        'source/components/*.twig'
    ],



    ui: false,
    open: false,
    notify: false,
    ghostMode: false,
    socket: {clientPath: ''},

    logLevel: 'info',
    logPrefix: 'Browser-sync',

    watchEvents: ['change', 'add'],





    rewriteRules: [
        {match: /&lt;\/head&gt;/i, fn(request, result, match) {
            return `&lt;script src="http://${address}:${webpack}/build.js"&gt;&lt;/script&gt;` + match
        }}
    ],

    snippetOptions: {
        ignorePaths: adminPath + '*',
        rule: {
            match: /&lt;\/body&gt;/i,
            fn(snippet, match) {
                return `&lt;script src="http://${address}:${sync}/${script}"&gt;&lt;/script&gt;` + match
            }
        }
    },

    middleware: [function(request, result, next) {
        if (request.url.startsWith(adminPath)) {
            result.writeHead(301, {Location: `http://${address}:${php}${request.url}`})
            result.end()
        } else {
            next()
        }
    }]
}