Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8349397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:59:07+00:00 2026-06-09T07:59:07+00:00

Background We use the Javascript library Three.JS for visualizing models stored up on Amazon

  • 0

Background

We use the Javascript library Three.JS for visualizing models stored up on Amazon S3.

I use the JSONLoader for all of my models. Other formats lack the toolchain support our team needs, and common formats like COLLADA or OBJ seem to be second-class citizens as far as the included loader libraries go (they are found, for instance, in the source tree under “examples”… the JSONLoader is in the core loaders folder).

I have large model files, and so store them and their associated assets up on Amazon S3 storage, where bandwidth and space are relatively cheap. The intent is that the web app using Three.JS loads models from our storage on Amazon, and everything is okay.

Problem

Unfortunately, the models are Javascript files (“modelBlah.js”, for example) and when they are loaded by the JSONLoader any sane browser immediately pouts about the fact that we’re violating the same-origin policy for scripting–e.g., we’re loading and attempting to evaluate scripts from a different domain than the calling script (which is the main harness for the app).

So, it would seem that we’ve flown in the face of many years of web security best practices.

Solutions looked at so far

  • Host the models ourselves? We’re using Heroku for now, and ideally we’d like to use a service specifically billed as “Big Buckets of Bits and Bandwidth” instead of doing it ourselves.

  • Use DNAME records to spoof where the resources come from? Unfortunately, this doesn’t seem sufficient to fool browsers, as the subdomain used for the media hosting would still enrage the browser security.

  • Use CORS, specifically Access-Control-Allow-Origin headers? Brief skimming of Amazon S3 doesn’t seem to allow this, though I am hopefully mistaken. Even so, would that be sufficient?


Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:59:11+00:00Added an answer on June 9, 2026 at 7:59 am

    S3 does not yet allow you to set CORs. To work around this exact problem, I ended up running an EC2 instance to act as a proxy server for downloading the models. The proxy (currently just running node) grabs the file from S3, sets the CORs header and passes it down to the application. There are a lot of options for the node setup including the knox or bufferjs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, first some background, I can't use any javascript library except YUI for this
If I use @import icon/*.png; @include all-icon-sprites; I can use background-position: sprite-position($icon, foobar); to
Coming from a JavaScript background I've become accustomed to being able to use JavaScript's
I am trying to use javascript to control the background color of a form
Background I use JScript (Microsoft's ECMAScript implementation) for a lot of Windows system administration
Background: I use rails g scaffold hotel name stars:integer to start fast (and insert
A little background: I use PowerShell on windows xp at work and I set
Is it possible/recommended to use background worker threads with the web browser control? I
I've been following a tutorial that explains how to use background for a button
I have to design a form with an input inside it. I use background

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.