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 8564867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:17:38+00:00 2026-06-11T17:17:38+00:00

I am trying to do cross site ajax using tinyproxy as a reverse proxy.

  • 0

I am trying to do cross site ajax using tinyproxy as a reverse proxy. Here is the setup:

  • A desktop system running gentoo linux. Ip address is x.x.x.x. Boa (web server, port 80) and tinyproxy (http proxy, port 8888) is running on this system.

Here are the test files:

======= a.html ======

<html>
  <head>
    <meta charset="UTF-8" />
    <title>Ajax test</title>
  </head>
  <body>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript" src="a.js"></script>
  </body>
</html>

======= a.js ========

$(document).ready( function() {

    function error_func()
    {
        alert("error occurred");
    }

    function ajax_func(data)
    {
        alert("ajax received");
    }

    $.get("http://x.x.x.x:8888/outside/xyz.txt", ajax_func).error(error_func);

});

I have configured tinyproxy so that http://x.x.x.x:8888/outside/ will go to http://www.outside.com/. I control that domain and I have placed a text file there, xyz.txt, with the “test string” in it.

Now, when I put the following url into firefox: x.x.x.x:8888/xyz.txt, everything works and I see the “test string” displayed in the browser window. But when I put x.x.x.x/a.html into firefox, I get the “error occurred” dialog box. I have tried this on IE, Safari, Firefox, and Chrome and I get the “error occurred” dialog in all of them.

Please note that I am aware of the “same origin policy”, that’s why I am using tinyproxy to get around that limitation.

I used wireshark on the gentoo linux machine to watch the traffic. Everything looks ok. I see an HTTP transaction between firefox and x.x.x.x, then I see an HTTP transaction between x.x.x.x and “outside” and finally another HTTP transaction between x.x.x.x and firefox. The HTTP 200 OK includes the “test string” as expected. But still, jquery isn’t happy and I don’t get the “ajax received” dialog box…

One thing I am suspecting is the HTTP “Server” header. The x.x.x.x system says “Server: Boa”, but the final response has “Server: Apache”. Would I be violating the same origin policy because of this difference?

  • 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-11T17:17:39+00:00Added an answer on June 11, 2026 at 5:17 pm

    The same origin policy restricts access to the:

    • same host
    • same protocol
    • same port

    The same origin policy applies also to your case because you try to access x.x.x.x:8888 from x.x.x.x:80.

    you need to deliver the content also over the same port.

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

Sidebar

Related Questions

I'm using JQuery 1.7.2, trying to do a cross site Ajax request which should
So, I'm trying to make cross-site AJAX request from my own script to the
I'm trying to call a WCF service cross-domain using javascript, over http. I've added
I am trying to find a cross linux distribution solution to the problem of
I'm trying to develop a cross-platform application using C++ with boost. I typically program
I am trying to figure out how to properly setup my crossdomain file. Here
I'm trying to do an XMLHttpRequest from a local file (file://) using JQuery.ajax to
I'm trying to better understand Cross Site Scripting and lets use: http://api.beatport.com/crossdomain.xml as the
I'd like to protect my site against cross-site request forgery . I'm trying to
I'm trying to get cross browser support for my HTML5/CSS3 site with the Selectivizr

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.