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

native mode curl integration in neutralino or fetch with cors disabled #61

Open
tridoxx opened this issue Oct 6, 2022 · 2 comments
Open

Comments

@tridoxx
Copy link

tridoxx commented Oct 6, 2022

hello, I hope you are well, I would like to know if in the future you are thinking of integrating something like javascript fetch, natively, with cors disabled, since I would like to develop using this framework, and it generates cors errors, another way is to integrate curl, in a way something like neutralino.app.curl or neutralino.app.fetch . Or I would like to know how much it would cost in money to contribute so that they can do this as a priority. I'm waiting for your answers

@danidre14
Copy link

I agree. But rather I think two cases can be considered:

Option 1: Custom API

Rather, than disabling cors, maybe it should be a c++ wrapper around curl or some request package, that is exposed via Neutralino.app.request or some such name.

Then we have to consider additional things for the implementation:

  • are we expecting to receive/send cookies and headers as well?
  • are we expecting to set/store cookie responses received, to the client as well?
  • any other I may have missed

Option 2: Disabling the Webview Adherence to CORS

I think election has an option where you can bypass the browser cors and just send the request. Of course, it is a dangerous thing if developers do not know what they are doing, so I picture Neutralino having a section in their security page detailing the dangers around it if devs do not know what they are doing.

In both cases, this should be an option the dev will have to explicitly enable in the neutralino.config.json file.

Maybe if I knew c++ I could do the first option. We use a fork of the https://github.com/webview/webview library for the desktop app so I'll have to depend on the possibility there with them if option 2 is to be considered.

@viralgupta
Copy link

@tridoxx i think this is what you are looking for https://github.com/hschneider/neutralino-curl, this is a cpp extenstion which helps you run curl commands with neutralino.js

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

3 participants