GetScatter / ScatterDesktop

Connect to applications on EOS, Ethereum, and Tron. Exchange tokens with ease. Manage your assets safely. All in a simple to use interface.
https://get-scatter.com/
GNU General Public License v3.0
500 stars 198 forks source link

Problem with logic to store socket with request origin as key value when localhost #502

Open gtolarc opened 4 years ago

gtolarc commented 4 years ago

When I connect to the scatter from localhost, I get an error that the socket cannot be found.

https://github.com/GetScatter/ScatterDesktop/blob/master/electron/services/sockets.js#L76 https://github.com/GetScatter/ScatterDesktop/blob/master/electron/services/sockets.js#L32

The above code part is related. It seems to determine origin as the appName of the client side, not the hostname, only when the client side has the localhost address. Since appName usually contains a space character in the middle, it usually only has a problem when using localhost in the development environment like me, and usually there will be no problem.

However, it is too inconvenient when developing. I think it would be nice to not trim it. I actually removed the trim and confirmed that it works.