You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. This is a complicated issue, hopefully I'll be able to explain it correctly.
So I want to use BrowserSync on a live website where I have no access to the code. I'm not using the proxy so I can still maintain the cookies needed for login and other kinds of things, so I managed to create a Chrome extension to append the needed script tag into the DOM and replacing the src to localhost instead of using .replace() with the hostname.
All goes well, script gets executed, but I noticed the GET requests to socket.io are using the hostname instead. Is there any way to override it somehow? I was expecting the requests to be based on the location where the initial .js file is at.
So I narrowed the problem down and it seems the only way I can solve this is by changing the socket option. Tried following one of the examples in the docs, changing the namespace to localhost:3000 and the polling requests are definitely coming through.
The weird part though is that even though the requests have statuses of 200 (and 101 for the websocket) it doesn't seem to work after the namespace change. No notification of BrowserSync being connected, even after enabling debug logs. Seems like a duplicate of #621.
Activity
diagramatics commentedon Jun 26, 2015
So I narrowed the problem down and it seems the only way I can solve this is by changing the
socketoption. Tried following one of the examples in the docs, changing the namespace to localhost:3000 and the polling requests are definitely coming through.The weird part though is that even though the requests have statuses of 200 (and 101 for the websocket) it doesn't seem to work after the namespace change. No notification of BrowserSync being connected, even after enabling debug logs. Seems like a duplicate of #621.
Help?
shakyShane commentedon Jun 26, 2015
Confirmed this is not working correctly.
We'll look at this asap.
diagramatics commentedon Jun 26, 2015
Ah, I guess a title change is in order. Thanks.
[-]Socket.io polling URL based on where loaded JS relative path?[/-][+]socket option not working properly[/+]fix(socket-options): allow socket.domain string|fn for setting domain…
shakyShane commentedon Jun 28, 2015
Fixed in
v2.7.13The original implementation was completely broken (where setting the namespace allowed a url, doh!).
now, to achieve what you want, it's the domain property you want.
diagramatics commentedon Jun 28, 2015
Yep, confirmed working. Thanks!