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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:04:40+00:00 2026-05-31T00:04:40+00:00

I am trying to write a simple proxy application on Android in Java to

  • 0

I am trying to write a simple proxy application on Android in Java to filter URLs. What it does is basically read everything on the incoming Socket, write everything to the server and vice versa. Everything works fine if I point my Opera mobile Browser to it. I want to make it transparent though, so I tried to redirect all traffic to it via these iptables rules:

iptables -t nat -A OUTPUT -m owner --uid-owner 10090 -j ACCEPT
iptables -t nat A OUTPUT -p tcp --dport 80 -j REDIRECT -p tcp --to-port 8081

I then get an error message, stating that “the server communication failed”.

Could it be that when using the proxy in transparent mode, it has to behave differently, e.g. like a webserver? I read somewhere that when using squid transparently, you have to configure it to be in “transparent mode”.

Or is there an entirely different reason?

  • 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-05-31T00:04:42+00:00Added an answer on May 31, 2026 at 12:04 am

    Answering my own question.

    The iptable rules work perfectly, so that was not the problem. The error message brought me on the right track. It states that “the server communication failed”, so there was something wrong with the way my proxy responded to the browser.

    Turned out it did not send any HTTP Headers to the browser, because I used URLConnection to communicate with the real webserver. URLConnection takes care of the HTTP Protocol, that’s why the browser wasn’t seeing any headers in the response. I then switched to the Socket API to talk to the webserver, and just forwarded everything back to the browser, which included headers and everything, and it worked!

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

Sidebar

Related Questions

I am trying to write a simple Android application using the NDK and C++.
I'm trying to write simple proxy server for some purpose. In it I use
I am trying to write a simple program to open a socket channel to
I'm trying to write a simple WPF application in C#. Coming from a primarily
I am trying to write simple dcmtk application I adeed the following header #include
I'm trying to write a simple form. The form basically need to validate 2
i'm playing with IOCP. I'm trying to write simple application that async reads data
Hi trying to write a simple linq query from a tutorial I read. But
I am trying to write a simple application that monitors the COM port and
I'm trying to write a simple python web application using the Tornado web server

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.