chris - @AdrianP I compiled fb v2.19.1 on a lin...

@AdrianP I compiled fb v2.19.1 on a linux mint system to test some minor modifications. I can compile (npm i; gn serve) and open fb at localhost:4200. But although I changed the ip of the DEV_SERVER in app.facade.ts, in fb I get the massage, that it cannot connect to my sk server at that ip. When I do the same with an older fb version (v1.19.1) it works. What could be the issue here?
6 Replies
AdrianP
AdrianP3w ago
You will have to add localhost:4200 to your servers CORS configuration (Admin Console)
chris
chrisOP3w ago
Ok, thank you. Do I have to do this even if I try to access fb via browser from the the same system that I compiled fb on? Do I need to modify my browser configuration or do I have to change the network configuration of the system?
AdrianP
AdrianP3w ago
If the host and port are the same you should not have to do anything.
chris
chrisOP3w ago
I run both the compiled fb as well as the browser to access localhost:4200 on the same system (linux mint laptop). The sk-server runs on a raspberry in the same network. After now having read a bit about CORS I think I roughly understand the issue (fb runs as app on a certain IP but it also tries to connect to another IP (=sk-server)), this seems not to be allowed by the current CORS configuration. Do I interpret this right? But I still have a hard time to understand what I should do, to allow fb to connect to the sk-server: Do I need to do something in my browser, in the network configuration of the system, or do I have to change something in fb? What I find online all does not seem to apply to my specific issue (or at least I don't see this). Any hint or suggestion, what specifically I should do would be much appreciated!
AdrianP
AdrianP2w ago
You will need to go into the signalk server admin console and in security find the CORS section and either enter * or localhost:4200 This should allow connection.
chris
chrisOP2w ago
That did the trick. Was the first time for me to hear about CORS, also haven't seen the corresponding configuration in sk ad min console before. Now all fine, thank you!

Did you find this page helpful?