Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

x-domain-object-proxy

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

x-domain-object-proxy

Helps older versions of IE make XDomainObject requests from HTTP protocol pages to HTTPS

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

X-Domain-Object-Proxy

Package for web applications which wish to support IE 8-9 and need Cross Domain Request Support, specifically from HTTP pages to HTTPS.

Motivation:

The limitations of XDR functionality in IE 8 and 9 are described in this blog post: http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx. This library intends to provide the workaround for point 7. Please be aware of the other limitations and requirements on the server side around headers and response types as mentioned in the blog post, if you intend to support IE 8 and 9.

Installation:

npm install --save x-domain-object-proxy

Proxy:

You will need to be able to set up an HTTPS folder on your web server and serve a html page which loads the XDomainObjectProxy.proxy.js file and starts the proxy. A sample html file might look something like this:

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
    <title>proxy</title>
  <script type="text/javascript" src="http://mydomain.com/scripts/XDomainObjectProxy.proxy.js"></script></head>
  <body>
    <script>XDomainObjectProxy.proxy.start();</script>
  </body>
</html>

We have a template src/proxy/proxy.ejs which you can incorpate into your webpack build, or use your own template

Client:

You will then use the request helper as such:

// Either ES6 Import 
import {create} from 'XDomainObjectProxy.client'
var client = create();

// Or as a global object from using <script> tags
var client = XDomainObjectProxy.client.create('https://localhost:8081/proxy.html');

/**
 * some other code ...
 */

var options = {
  location: 'https://api.nasa.gov/planetary',
  path: '/apod',
  qs: {
    'api_key': 'DEMO_KEY'
  }
}
client.sendRequest(options).then(function (data) {
  console.log('data returned', data);
}, function (err) {
  console.log('error', err);
});

Keywords

FAQs

Package last updated on 30 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc