Home > front end >  Is there any way in js cross-domain perform like HTTP requests in a programming language?
Is there any way in js cross-domain perform like HTTP requests in a programming language?

Time:10-06

Don't know much about the js, probably, checked the XMLHttpRequest can't seem to cross domain, the json if cannot take the header, and want to be in the requested server is to set up the Access - Control - Allow - the Origin of the head, is there any way in js simulation like the HTTP requests in a programming language, do not need to set up the server, can cross domain, you can set the header, just get returns text,

CodePudding user response:

Add a proxy server front-end deployment

CodePudding user response:

This is for security reasons,

To know the general program can be completely control the whole computer, can be formatted disk, can be read from disk in any action, also can download anything on the Internet, can automatically install any program, also can not subject to consent by the users to upload any file to the server,

Obviously, you don't want to visit a web site, your computer as the web programmer mercy,

In the browser cannot cross domain, in addition to ban literally read user file, ban literally read the clipboard contents, click on the download file is not allowed,

CodePudding user response:

Cross-domain limitation is that the client browser, not js pot, no restrictions on the server side using js,
Want to say, as long as the limit cross-domain read user client local files, cross-domain restrictions between websites in fact it is not necessary,
You say for the sake of safety, as long as able to cross domain with their own server agent read, don't just get security on the server side?

CodePudding user response:

reference 3 floor sky waves reply:
cross-domain limitation is that the client browser, not js pot, no restrictions on the server side using js,
Want to say, as long as the limit cross-domain read user client local files, cross-domain restrictions between websites in fact it is not necessary,
You say for the sake of safety, as long as able to cross domain with their own server agent read, don't just get security on the server side?

What is the meaning of the agent? The reverse proxy server do transfer request?

CodePudding user response:

reference 4 floor shuangyouao6121 response:
Quote: reference 3 floor sky waves reply:

Cross-domain limitation is that the client browser, not js pot, no restrictions on the server side using js,
Want to say, as long as the limit cross-domain read user client local files, cross-domain restrictions between websites in fact it is not necessary,
You say for the sake of safety, as long as able to cross domain with their own server agent read, don't just get security on the server side?

What is the meaning of the agent? The reverse proxy server do transfer request?
https://www.cnblogs.com/lydialee/p/4869145.html

CodePudding user response:

refer to fifth floor of the sky wave response:
Quote: refer to 4th floor shuangyouao6121 response:

Quote: refer to the third floor of the sky wave response:

Cross-domain limitation is that the client browser, not js pot, no restrictions on the server side using js,
Want to say, as long as the limit cross-domain read user client local files, cross-domain restrictions between websites in fact it is not necessary,
You say for the sake of safety, as long as able to cross domain with their own server agent read, don't just get security on the server side?

What is the meaning of the agent? The reverse proxy server do transfer request?
https://www.cnblogs.com/lydialee/p/4869145.html


Ah, I'm side needs to users through the web page to submit a get request, the target server according to the different text of IP to return after receipt of the request, if by that you just is the target server can only received the request of the same IP? Is there any other way to achieve
  • Related