Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble customizing socket namespace #87

Closed
leigeber opened this issue Dec 15, 2014 · 3 comments
Closed

Trouble customizing socket namespace #87

leigeber opened this issue Dec 15, 2014 · 3 comments

Comments

@leigeber
Copy link

We are trying to figure out a way to support HTTPS development and are running into an issue. The hacky solution we've worked up is to always run the proxy since it supports HTTPS so we can grab the secure reload snippet. Then we paste that into our code. That part works fine and the source of the browser sync script looks correct.

Where we're getting hung up is the socket namespace to keep it pulling from localhost and not the local virtual host URL. We are settings the following:

grunt.config.set('browserSync.options.scriptPath', function(path) {
    return 'https://localhost:9000' + path;
});

grunt.config.set('browserSync.options.socket.namespace', function(namespace) {
    return 'https://localhost:9000' + namespace;
});

It appears to load everything correctly looking at the net panel but the response to one of the subsequent responses is below:

���44/browser-sync/socket.io,"Invalid namespace"

Hope that makes sense. Any ideas?

@cajoy
Copy link

cajoy commented Jan 5, 2015

have the same issue but without HTTPS...

Have no clue how to resolve it...

@GaretJax
Copy link

GaretJax commented Jan 9, 2015

Same as for @cajoy.

shakyShane added a commit to BrowserSync/browser-sync that referenced this issue Feb 8, 2015
@shakyShane
Copy link
Contributor

Please see: BrowserSync/browser-sync#690.

You can now explicitly set just the domain for the socket connection.

To get this fix within the grunt plugin, you'll need to

npm rm grunt-browser-sync && npm i grunt-browser-sync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants