Bypassing Proxy Server through java
Hi !!
I`m creating a web browser in JAVA for my college project.I`m using JEditorPane to display HTML in my browser.
My project is running fine at my home where i`ve no proxy but in college, I have a requirement to display HTML pages through a Cyberoam Server running at port 3128.The authentication is done thru Cyberoam client software which is done by the user itself on logging into Windows, so my application has no role in that.
Please help me in regards to how to move through this Cyberoam firewall.
Waiting for a response,
Amit Sharma
remember Google is your friend. I got this off of a Google
http://java.sun.com/developer/technicalArticles/DataTypes/proxy/
Since this is for a college project and the instructor had imposed the requirement of using Cyberoam, I'd suggest you take better notes in class--I've never had a class where the instructor made something mandatory without a discussion on how to approach it and supply resources where nessisary to do so.
Similar Messages
-
Getting problem when connecting to SMTP server through java code
Hi all,
I am getting problem when i am going to connect with "Kerio SMTP server" through java code. The error what i am getting is :
"[16/Sep/2008 15:59:09] Sent: Queue-ID: 48cf8a73-000000f9, Recipient: <[email protected]>, Result: failed, Status: 5.3.2 554 5.0.0 Too many hops (101, max 100), message looping" when sending an email from [email protected]Looks like something is set up wrong on your server that's causing messages
to be forwarded around a loop too many times without ever reaching the destination.
For instance, if server A forwards to server B, and server B forwards to server A,
this would happen. -
Acessing cisco iso server through java
Hi All,I am trying to access cisco iso server through java but i am getting timeout exception in program i am creating a client object pass all the parameter.it seems my program no is not registered.so anybody give any suggestion
Posted by WebUser Tubu Mohanty from Cisco Support Community AppAfter trying to resolve the issue Cisco TAC sen the following message:
I will proceed to open a task with my escalation Team. As well I find this,
http://www.cisco.com/en/US/products/hw/vpndevc/ps2284/prod_release_note09186a00804ceedf.html#wp521096
Look after CSCec78536
"WebVPN does not support Java applets that generate http requests. For example, you cannot login to the CiscoSecure ACS application because of this. "
If anyone has any additional information please post. We are running into more and more prospects/clients using WebVPN approach (w/ out SSL VPN) for providing remote application access.
Regards,
-Murat -
It is possible to bypass proxy server from inside LAN
Hi ,
We have a proxy server which is used to provide internet access to LAN clients . I want some clarification regarding ,whether can anyone bypass our proxy server to access internet .It depends what kind of deployment you've. If you've explicit forward proxy the disadvantage include a user's ability to alter an individual client configuration and bypass the proxy.
You can also use a Group Policy Option (GPO) setting to prevent users from changing proxy settings in windows enviornment. If you cannot enforce group policy settings on client machines, this type of configuration can be difficult to maintain for a large user base because of the lack of centralized management.
~BR
Jatin Katyal
**Do rate helpful posts** -
How to create Proxy Server in Java
Hello I need to create Proxy server on port number 80. Does enybody knows how to do that.??? ThX
A proxy for what?
I assume that you mean a web proxy since you want to run port 80.
I would recomend that you start with an existing proxy like mine.
http://www.khelekore.org/rabbit/
It is free and fully HTTP/1.1 compliant. -
Connectiong to Exchange Server through JAVA
Hi friends,
I am new to java mail.i have a problem with connecting to exchange server thru java. my java program sends a mail.but i want to get an alert when ever received a mail and also download the mail to local disk from exchange server.
so if you can please help me.Reply to this ,send me the links or sample codes / paste here itself.
Advance Thanks,
Sankar.PHi friends,
I am new to java mail.i have a problem with connecting to exchange server thru java. my java program sends a mail.but i want to get an alert when ever received a mail and also download the mail to local disk from exchange server.
so if you can please help me.Reply to this ,send me the links or sample codes / paste here itself.
Advance Thanks,
Sankar.P -
Hi guys,I am creating a network program but unfortunatly i cannot test it because i live in university halls and I am behind a very strict proxy.Does anyone knows how can I by pass the server?
Thank you all
Adam
here are my last 5 duke dollars,please if you know anything please tell me its really important for me.It's trivial to stop using a proxy, but the proxy's purpose isn't to restrict. That's the firewall's job. Bypassing the firewall would be very difficult (its purpose is that it can't be bypassed) and it may be against your school's rules.
Like t said, talk to the network guys.
I doubt they'd reconfigure anything for your benefit, but they might point out other options. For example, if the firewall blocks everything but the proxy lets HTTP go through, maybe you can rework your app to use a web services model. -
Connect to unix server through java
Hi All,
I've seen this topic being discussed here, but I want to clarify my situation.
I'm a college student, so our school provides us accounts to a unix server.
I am writing a java program that needs to connect to this unix server owned by the school, and run some commands and obtain the results and display them in the same java program.
for example after the connection, I use the java Runtime() method to pass the "pwd" command from my program, and my java program should receive the result something like "/university/student/program" from the server, and I should be able to display in the java program.
I feel like since the unix from school is already acting as a "server," I don't need to write the server side code, it should be handled by the unix system, right?
Can someone give me a sample code on how to establish such connection?
BTW, I usually use ssh to access the unix server.
Much appreciated, and it's kinda urgent.
Thank You.There are ssh clients written in Java so I'm not really sure you really want the following code because it accesses ssh using Runtime.exec(). I have never used this with anything except Linux so I assume that your client ssh is in a directory that is on the PATH.
If your server ssh is set up to do public key authentication then you will not have to supply the user password. If you do require a password then on Linux FC5 you will be prompted though a dialog. I don't know how you provide the password in Windows.
import java.io.*;
public class Fred117_1
static class AsyncPipe implements Runnable
public AsyncPipe(InputStream istrm, OutputStream ostrm)
istrm_ = istrm;
ostrm_= ostrm;
public void run()
try
final byte[] buffer = new byte[1024];
for (int length = 0; (length = istrm_.read(buffer)) != -1;)
ostrm_.write(buffer, 0, length);
catch (Exception e)
e.printStackTrace();
private final OutputStream ostrm_;
private final InputStream istrm_;
public static void main(String[] args) throws Exception
final boolean isWindows = System.getProperty("os.name").startsWith("Windows");
final String LINE_SEPARATOR = System.getProperty("line.separator");
final Process process = Runtime.getRuntime().exec(isWindows ? "cmd.exe" : "sh");
new Thread(new AsyncPipe(process.getErrorStream(), System.err)).start();
new Thread(new AsyncPipe(process.getInputStream(), System.out)).start();
final Writer writer = new OutputStreamWriter(process.getOutputStream(), "UTF-8");
final String[] shCommands =
"ssh alpha",
"df -k",
"ls",
for (String shCommand : shCommands)
System.out.println(shCommand);
writer.write(shCommand);
writer.write(LINE_SEPARATOR);
writer.close();
final int returnCode = process.waitFor();
System.out.println("Return code = " + returnCode);
} -
How to know whether bypass proxy for local address is enabled in browser
Can anyone help me in finding out whether the check box "bypass proxy server for local address" in Internet explorer (Tools->Internet options->Connections->LAN Settings) is enabled from java plug in.
In my applet application if that checkbox is enabled then i have to throw a message saying that the checkbox is enabled.
Thanks in Advance
Regards
VijayWe have been in discussions with Microsoft over the last few days on this issue - which is seen with Outlook 2007 versions onwards. Extract from resolution communication from Microsoft:
The issue you have raised is known as it has been reported and when you have a proxy set in Internet Explorer and “Bypass proxy settings for local addresses”, Outlook will attempt to connect to Office 365 directly – like the bypass rule would apply.
Because the direct connection is blocked in the Firewall, Outlook needs to have the connections going in Timeout before attempting to connect using the Proxy.
Your network trace proves the issue.
Microsoft have scheduled a fix for Outlook 2010 in February 2014 cumulative update. A fix for Outlook 2013 will also follow, but Outlook 2007 will not be addressed because it is in Extended Support.
There are two possible workarounds for this behaviour:
First, and I wouldn’t recommend it, is to allow Direct traffic through the Firewall to Office 365.
The advantage of this approach is that it will be done centralized and it will impact everyone immediately.
Information about the O365 IP addresses
There are two downsides to this behaviour:
1. First you need to maintain the Firewall exceptions as IP from O365 server can change without notice
2. Second, winhttp traffic may go through both proxy and direct and this can cause unforeseen behaviour.
The second approach is to use a proxy pac instead of manually setting in the proxy and the exceptions.
The advantage is that you will have centralized method to control how winhttp traffic goes and the issue will not be experienced anymore.
If a single pac does not be fit, you can configure proxy pac files for each site requirements and use an IIS server to store it. -
Help to boost the performance of my proxy server
Out of my personal interest, I am developing a proxy server in java for enterprises.
I've made the design as such the user's request would be given to the server through the proxy software and the response would hit the user's browsers through the proxy server.
User - > Proxy software - > Server
Server -> Proxy software -> User
I've designed the software in java and it is working
fine with HTTP and HTTPS requests.The problem which i am so scared is,
for each user request i am creating a thread to serve. So concurrently if 10000 users access the proxy server in same time,
I fear my proxy server would be bloated by consuming all the resources in the machine where the proxy software is installed.This is because,i'm using threads for serving the request and response.
Is there any alternative solution for this in java?
Somebody insisted me to use Java NIO.I'm confused.I need a solution
for making my proxy server out of performance issue.I want my
proxy server would be the first proxy server which is entirely
written in java and having a good performace which suits well for
even large organisations(Like sun java web proxy server which has been written in C).
How could i boost the performace?.I want the users should have no expereience of accessing the remote server through proxy.It would be like accessing the web server without a proxy for them.There should be not performance lagging.As fast as 'C Language'.I need to do this in java.Please help.I think having a thread per request is fine.Maybe I got it wrong, but I thought the point in
using NIO with sockets was to get rid of the 1 thread
per request combo?Correct. A server which has one thread per client doesn't scale well.
Kaj -
Fetching a URL from a socket output or input stream in a proxy server
We have written a proxy server in java .
It connects with a client on some local port and forwards the request of the client to main server through socket connections.
The code is as follows...
* BasicProxyServer.java
* A simple multithreaded proxy server.
* A client connects to theserver. The server starts a
* separate threads for data flow though two Sockets.
* The first socket communicates with the socket of the client.
* The second socket is used to communcate with the main server
* for which this server is a proxy. The sockets are connected by pipes.
import java.net.*;
import java.io.*;
public class BasicProxyServer {
private static int serverPort;
private static String primaryServerHost;
private static int primaryServerPort;
// 1st arg: port to listen on
// 2nd arg: primary server IP
// 3rd arg: primary server port
public static void main(String [] args) {
serverPort = Integer.parseInt(args[0]);
primaryServerHost = args[1];
primaryServerPort = Integer.parseInt(args[2]);
BasicServer bserv = new BasicServer(serverPort,primaryServerHost,primaryServerPort);
class BasicServer extends Thread {
private int serverPort;
private String primaryHost;
private int primaryPort;
private ServerSocket servSock = null;
public BasicServer(int port, String primSrv, int primPort) {
serverPort = port;
primaryHost = primSrv;
primaryPort = primPort;
start();
public void run() {
Socket clientSock = null;
Socket primaryServerSock = null;
try {
servSock = new ServerSocket(serverPort);
catch (IOException e) {
e.printStackTrace();
while(true) {
try {
clientSock = servSock.accept();
primaryServerSock = new Socket(primaryHost, primaryPort);
PipedInputStream fromClient = new PipedInputStream();
PipedOutputStream toMainServer = new PipedOutputStream(fromClient);
PipedInputStream fromMainServer = new PipedInputStream();
PipedOutputStream toClient = new PipedOutputStream(fromMainServer);
Talk clientToMainServer = new Talk(clientSock, fromClient, primaryServerSock, toMainServer);
Talk mainServerToClient = new Talk(primaryServerSock, fromMainServer, clientSock, toClient);
clientToMainServer.start();
mainServerToClient.start();
catch (IOException e) {
e.printStackTrace();
// Override finalize() to close server socket
protected void finalize() {
if (servSock != null) {
try {
servSock.close();
} catch (IOException e) {
e.printStackTrace();
servSock = null;
class Talk extends Thread {
private Socket incoming;
private Socket outgoing;
private InputStream in;
private OutputStream out;
private InputStream from;
private OutputStream to;
Talk(Socket inSock, InputStream in, Socket outSock, OutputStream out) {
this.in = in;
this.out = out;
incoming = inSock;
outgoing = outSock;
public void run() {
int aByte;
try {
from = incoming.getInputStream();
to = outgoing.getOutputStream();
while(( aByte = from.read()) != -1 ) { //read from socket
out.write(aByte); // write to pipe`
// read the byte from the pipe
to.write(in.read()); // write it to the output socket stream
to.flush();
to.close();
from.close();
if(incoming != null) {
incoming.close();
incoming = null;
if(outgoing != null) {
outgoing.close();
outgoing = null;
catch (SocketException e) {
// there is one for a closed socket. Seems to have no effect.
// e.printStackTrace();
catch (IOException e) {
e.printStackTrace();
Here,when client gives any URL in the address bar in the web browser the request is forwarded to this proxy server.
We want to fetch the URL which client enters in order to implement content filtering and also store the most visited sites by each user .
But we don't know how to fetch the URL from the socket input or output stream.
Can you suggest any suitable solution for the same??Shailesh24 wrote:
We want to fetch the URL which client enters in order to implement content filtering and also store the most visited sites by each user .
But we don't know how to fetch the URL from the socket input or output stream.
Can you suggest any suitable solution for the same??Yes. Write a proxy server that actually speaks HTTP. -
Bypass Proxy for Local Addresses - Office 365 connection/ Outlook 2010
This is a strange one. Connectivity to Office 365 within our netwotk works fine although very slow for outlook 2010 client to initially connect. Once connected, it works ok. I have done a netwotk trace using netmon to see if i can identify
the reason for the slow startup (2 mins minumum for profile to load and for outlook to connect to exchange). The trace tell me that my local pc tries to make a direct connection to the office365 external IPs first, then tries the TMG proxy. Once it hits the
proxy, it kicks into life and works.
So it looks to me like it thinks the external IP address of office 365 is an internal address and spends it time trying all the ip addresses until it trys the proxy. At this point, the
Bypass Proxy Server for Local Addresses is ticked.
As soon as i untick this box, all traffic heads directly to the proxy and of course it connects like lighting. The exchange settings proxy is set in outlook for "on fast networks, connect using HTTP first, then connect using TCP/IP" (tick
is on) and the same for slow networks.
I cant for the life of me work out why it tries to connect directly to the external IPs first and not connect via TMG until i untick the
Bypass Proxy Server for Local Addresses
Would love any ideas that may assist.We have been in discussions with Microsoft over the last few days on this issue - which is seen with Outlook 2007 versions onwards. Extract from resolution communication from Microsoft:
The issue you have raised is known as it has been reported and when you have a proxy set in Internet Explorer and “Bypass proxy settings for local addresses”, Outlook will attempt to connect to Office 365 directly – like the bypass rule would apply.
Because the direct connection is blocked in the Firewall, Outlook needs to have the connections going in Timeout before attempting to connect using the Proxy.
Your network trace proves the issue.
Microsoft have scheduled a fix for Outlook 2010 in February 2014 cumulative update. A fix for Outlook 2013 will also follow, but Outlook 2007 will not be addressed because it is in Extended Support.
There are two possible workarounds for this behaviour:
First, and I wouldn’t recommend it, is to allow Direct traffic through the Firewall to Office 365.
The advantage of this approach is that it will be done centralized and it will impact everyone immediately.
Information about the O365 IP addresses
There are two downsides to this behaviour:
1. First you need to maintain the Firewall exceptions as IP from O365 server can change without notice
2. Second, winhttp traffic may go through both proxy and direct and this can cause unforeseen behaviour.
The second approach is to use a proxy pac instead of manually setting in the proxy and the exceptions.
The advantage is that you will have centralized method to control how winhttp traffic goes and the issue will not be experienced anymore.
If a single pac does not be fit, you can configure proxy pac files for each site requirements and use an IIS server to store it. -
Outlook 2007 needs BT proxy server address to acce...
I have been through many sites and it transpires that using outlook 2007 to access an exchange server (2010) gives errors on syncing the offline address book where it just hangs on a send/receive.
MS know this is an issue and the only real workaround is to specify a Proxy server in the browser settings to allow access.
http://support.microsoft.com/kb/939765
The microsoft instructions are;
1.Start Internet Explorer, click Tools, and then click Internet Options.
2.On the Connections tab, click LAN settings.
3.Click to select the Bypass proxy server for local addresses check box, and then click Advanced.
4.Type the FQDN of the Exchange 2007 CAS server, and then click OK.
5.Restart Outlook.
All fine and good, but a proxy server address is required and I cannot find one for BT anywhere. Surely these must exist?
Any help appreciated as I do not want to have the expense of upgrading to outlook 2010 which 'may' work.
ThanksYou will need to delete the account and then re-create it as POP3, it is not possible to change from IMAP to POP3 on the fly. When you re-create the account, set it up using the manual option at the bottom of the screen rather than letting Outlook set itself up. In the Advanced tab, untick 'Leave a copy of messages on the server'.
-
How do I create a Https Proxy server
hi,
I am writing a Proxy server in java. But my pogram do not support https protocol.Could you please tell me how can I implement a https proxy server.some sample code is more helpful.
This is very URGENT for me.
Thanks
Sujith VargheseHi Varghese,
Reading the thread I am able to make out u r facing the same problem as I do.
current scenario#1:
Machine#1 client (using URLConnection("https://...") ----> Machine#2 (Server https port)
what I want scenario#2
Machine#3 client (using URLConnection("https://...") ---> Machine#1 (Proxy for https)----> Machine#2 (Server https port)
In scenario#1
- I have a Client machine at Location#1 which can connect to on Location#2
- I only have SSH connection to machine at Location#1
now this scenario#2 is what I would like to run so that
- I am able to connect to mc#2 at loc#2 from a machine at loc#3 with mc#3
- effectively starting a https proxy at location number mc#1 at loc#1.
Hope that clears the problem domain.
any help will be greatly appreciated.
regards-
_Jagsir -
Hi! Proxy Server Implementation Help required!
Hello Everybody!
I am new to java networking and I want to develop Proxy Server in Java. Could somebody tell me where and how to start. Any help will be highly appreciated. Thanks in advance.That's a slightly better idea than writing a firewall in Java.
Where I would start would be to decide what the proxy server was supposed to do. For example, what protocols should it proxy? HTTP? FTP? Others? And should it require authentication? What other services should it provide?
Maybe you are looking for
-
Migrate Oracle EBS 12.1.3 from Microsoft Windows 2003 32-Bit to Linux
Hi We are currently using Oracle EBS 12.1.3 on Microsoft Windows 2003 32-Bit. We are planning to migrate to linux. I have gone through the certification matrix and the following versions certified with Oracle EBS 12.1.3 1. Linux x86 Oracle Linux 5 2.
-
How do I fix Apple TV/iTunes Sync issue (port 3689)
I am having a port 3689 issue, I looked through all the other topics on it here, seems common, I only just bought my Apple TV unit and thinking about returning it, the guy from Apple support tried his best but still no fix. iTunes says port 3689 is b
-
E51 WLAN - File sharing with another PC on home WL...
Hi, I have recently bought E51 and had no trouble setting up the WLAN accesspoint and browse the net / check emails / download software. All works very well. The tutorial on phone suggest that one can share files etc. between the phone and another PC
-
Index rebuild in oracle version 8i
Hi All Is there any other way we know which indexes we can rebuild in a database which is using RBO in oracle version 8 we dont want to analyze those indexes Thanks
-
How to put a check mark in a PDF document, if using an iPad 2
How to put an check mark in a PDF document, if using an iPad 2?