Cross domain request on localhost

DISCLAIMER: I have already considered various approaches to solving my problem, so please read this before designating this as a duplicate question

I have javascript running on https://xyz.comthat should retrieve information from an application ABCrunning on the user's local computer, for example, port 8080.

My limitations are that I cannot change the HTTP headers coming from the form ABC, and I do not want the user to install another application that will be a channel to route my requests to ABC.

Interdomain / window sharing options

a) window.postMessage: Excluded, since I cannot run the script on the local machine
b) XDR object (IE) or Access-Control-Allow-Origin (Firefox, Safari, etc.): Excluded, since I cannot change header
c) JSONP: This will not work again since I cannot enclose the answer in the function name

As a workaround, intended only for testing, I added http://xyz.comto the trusted list and included Access Data Across Domainsfor sites in this list. AFAIK, this option is available only in IE 5+ browsers. This workaround allows you to send and receive messages fromhttp://127.0.0.1:8080
alt text


1) , , , ? ?
2) , .

PS: ActiveX Flash, , , < /" >

+3
2

html-, , (, easyXDM) ajax- . .

easyXDM , .

+1

, script https://xyz.com, javascript ABC. javascript AJAX script, . , , Flash ActiveX, - JSONP, - , .

0

Source: https://habr.com/ru/post/1775900/


All Articles