Connect to socket server behind proxy?

My socket server is behind proxy.
Can client connect to server?
Thanks

Hi Sojan !
Server work,
but when run behind proxy=Exception.
Hier is part of code.
public static final int PORT=780;//port number
static Socket soc;
PrintWriter out;
BufferedReader in;
static boolean flag;//check connection
try{
ServerSocket ss=new ServerSocket(PORT);
flag=true;
while(flag){
soc=ss.accept();
v.in=new BufferedReader(new InputStreamReader(soc.getInputStream()));
Thread d=new Thread(v);
d.start();
}catch(Exception z){z.toString();
public void run() {
try{
while(flag){
String g="";
g=in.readLine();
if(g==null){break;}
//System.out.println(g);
jTextArea1.append(g+"\n");
catch(Exception c){
System.out.println("soc2 closed");
try{
soc.close();
}catch(IOException f){System.out.println("soc2 not closed");}
...

Similar Messages

  • Project professional 2013 can not connect to Project Online behind proxy

    Hi,
    I had problem when running application ms project professional 2013 connect to project online behind proxy,
    but we can access url PWA site in browser.
    but when we connect to pass through internet  we can connect project professional 2013 to project online.
    i get article http://technet.microsoft.com/library/hh373144.aspx to open port 443, but we already
    open port 443. 
    anybody  know how to troubleshoot this problem? or other port to open beside port 443.
    thansk for advice.
    regards
    rully

    Hi Ruly,
    Are you still having an issue? Could you share the error details, when you try to connect the MS Project to project online behind proxy?
    Cheers, Badal

  • Cannot connect to SGD server via proxy

    Hello
    We have a recently installed SGD server running.
    Some clients have been setup today with accounts to access it but none of them can get on at the moment. The error message presented is as follows:
    Cannot connect to the server sgd.ourdomain.co.uk:443
    The HTTP proxy "NTLM" at devicename:8080 failed to connect to the server sgd.ourdomain.co.uk:443
    The following response was returned:
    HTTP/1.1 403 Forbidden
    Clearly there's a proxy/firewall getting in the way.
    Client has tried to connect from a network that is behind a different firewall and has been sucessful.
    I'm hoping to get further details on the proxy/firewall setup but this could take a while.
    Has anyone encountered this previously and if so, can any solutions be suggested.
    Thanks,
    Rob

    Hi Team,
    I am facing the same issue and I am using Oracle system user credentials to connect Oracle server and I have also installed extension pack for the SQL Server instance which i am using for migration. Still I am getting the following error in last step (Migrate
    data).
    Cannot connect to Oracle server via SQL Server tester extensions.
    Oracle
    10.2.0.4 verion
    SQL Server 2012 SP1
    SSMA 6.0
    Please help me if you have gone through the same problem.
    Thanks,
    Vijaysqldb

  • Can't connect java socket server in MAC OS

    Does any know what settings need to be done in order to connect socket server written in java on MACOS.
    my socket server is running on 5000 port, i've tried on running server on linux, and my program is able to receive the request from remote unix server.
    but when the server is running on mac OS, the the unix server couldn' connect to the socket.
    is this a port blocking problem?
    can someone tell me what to do to make server on MAC OS available for receiving request?
    Thanks

    Who is the sys/net admin for the Mac?

  • Could setup VPN but could not connect to the server behind Windows

    Hello, 
    Server 1 and Server 2 are directly connect with cable. Server 1 has 2 NIC.
    I want to configure the following network, already have done most of the steps.
    Install the Role “Network Policy and Access Services.My
    router is configured to assign ip to NIC1 and Linux server. I enabled IP forwarding in Win server from registry. My clients are able to connect to
    VPN ->  and ping Server 1. But they are unable to ping Server 2 through VPN. But
    I am able to ping Server 2 directly from Server 1. Are Server 1 and Server 2 not in same LAN ? Should not outside users be able to ping Server 2 after successful VPN connect  ?
    Please help with conceptual errors.

    Hi,
    According to your description, my understanding is that VPN client failed to ping internal devices after connecting to VPN server.
    Ping command is used to detect network or host communication failures and troubleshoot common TCP/IP connectivity problems by sending ICMP echo request messages and record the receipt of ICMP echo reply messages. Turn off firewalls and protection software(if
    any) and then try to ping again. And, ping IP address instead of name.
    You have mentioned “enabled IP forwarding in Win server from registry”, since you have installed RRAS on VPN server, if you want the remote access clients to have access to resources on the intranet, I recommend you to enable NAT on VPN server.
    Besides, according to the picture, 2 NICs of VPN server and the Linux server are on the same sub network. In general, NIC 2 connects to internal network and NIC1 connect to external network. I recommend you to reference the link below for
    Step-by-Step Guide for Setting Up VPN-based Remote Access in a Test Lab(similar configuration with your VPN):
    https://technet.microsoft.com/en-us/library/cc757206%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396
    Best Regards,
    Eve Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How can I connect to a ServerSocket behind proxy ???

    Hi,
    I have been searching for this answer for a very long time. My question is simple:
    Let's say I have an Instant Messenger application written in Java. I will call it JICQ.
    If my JICQ is installed in a machine with invalid IP address (192.168.1.100) behind a proxy server (Wingate), how in the heck another JICQ outside my intranet can send me a point-to-point message ????
    How can an application from outside my Intranet get to my ServerSocket running on my machine with a invalid IP address and behind a proxy server ???
    I think ICQ does just that, and I am very curious in knowing how it does that.
    I will explain better the ICQ cenario:
    I am behind a proxy server (Wingate) and my machine has an invalid IP address (192.168.1.100).
    I have ICQ running on that machine.
    How can other people connect to my ICQ to send me instant messages and files ???
    Is it a point-to-point connection ??? (I think so)
    [ICQ] -------> [PROXY] --------> [My ICQ]
    I would be very thankful if someone can explain me that.
    []'s
    Sergio Oliveira Jr.

    Tony, could you please explain me better the procedure that you wrote?
    What are the boxes? My situation is similar:
    | ServerSocket (1) |
    | (192.168.1.100, 5555) |
    |
    |
    |
    |
    | Proxy |
    | Someone wants to connect to the ServerSocket (1) |
    That is not true. You CAN do it but you need a box
    outside the firewall with proper IP address to help
    you. I am not sure if Sergio still wants the answer
    today after more than a year from the original post (I
    did not see the post until today when I try to search
    for something else). Anyway, if such a box is
    available (I call it 2nd box), you could first
    establish a socket between the two boxes by HTTP
    tunneling (I assume it is a http proxy). You have to
    initiate the socket from the 1st box. Then start
    another server socket on the 2nd box, forwarding the
    traffic it gets from outside back to the 1st box using
    the established channel. That is it.
    Tony

  • Problem connecting to IM's behind proxy

    Hello,
    This is my first thread here, and I'm not really sure if I should pose this question to you guys, but you're my only hope of getting this fixed.
    The thing is I'm in a Mac running Leopard, and I'm behind a proxy here at my company. I can't connect to MSN, Gtalk, Facebook (through Adium or aMSN), as it just won't get by the "handshaking" process. I can't connect through the Microsoft Windows Messenger for Mac either.
    However, every Windows user can access MSN. All the ports the IM's use are available and open.
    For your knowledge, I'm connecting Skype, Tweetdeck, Entourage, Firefox, and everything is running well.
    Any clues? I'm completely lost here.

    I use Adium behind the corporate firewall. Adium has the ability to specify a proxy server for each account
    Adium -> Preferences -> Accounts -> yourIMservice -> Edit -> Proxy.
    I use the [X] Connection using proxy -> Type -> Systemwide HTTP Settings for AOL IM (AIM) and GTalk.

  • Client connection to a Server behind a router

    Hello everyone,
    I'm building a client / server application where the server will be my machine that is in residential gateway behind a router. the client will be out of the U.S. completely. On the client side the connection method (connectTo(InetAddress ip)) must know the server IP address in order to connect to it. I've tried configuring port-forwarding on my router to have it forward any connection under port 5555 to my local IP and passing my public IP on the client side to that connection method. Disappointingly, that didn't work. Here is my Code for the server:
    import java.io.*;
    import java.net.*;
    * Server class, to accept concurrent client
    * requests,through accepting socket connection
    * and establishing a new thread to provide the
    * desired service
    * @author True
    * @see source.ServiceProvider
    public class Server {
         * Creates a new instance of source.Server
        public Server(){
            try{
                ServerSocket ss = new ServerSocket(5555);
                while(true){
                    Socket sock = ss.accept();
                    ServiceProvider sp = new ServiceProvider(sock);
                     sp.start();
            catch(IOException x ){
                // handles exception here
         * Main method creates a new instance of Server
         * @param args String [] of parameters at the excusion time
        public static void main(String args[]){
            new Server();
    }And here is my code for the client:
    // irrelevant code here...
    private void connectTo(InetAddress ip){
             try{
                 Socket sock = new Socket(ip, 5555 );
    //           Building Streams
                 OutputStream os = sock.getOutputStream();
                 ObjectOutputStream oos = new ObjectOutputStream(os);
                 InputStream is = sock.getInputStream();
                 ObjectInputStream ois = new ObjectInputStream(is);
                 // more irrelevant code here...
             catch(IOException x){
                 // handle exception here
             catch(ClassNotFoundException x){
                 // handle exception here
    }Any ideas or comments are welcome and highly appreciated.

    true_lover wrote:
    All configuration seem fine. port forwarding is straight forward on the router page. I checked all numbers & values and all seemed fine.Well obviously it's not. Otherwise you wouldn't be getting a connection refused.
    The only other item worth checking is if your ISP is blocking the port. Which may well be happening.
    The other poster was correct, once you have the exception figured out (aka what it is) and it's connection refused this is not actually a Java related problem any more and you should take that question to a general networking forum.
    Edited by: cotton.m on 27-Nov-2008 7:46 PM

  • Help :Domain controler crash, how to connect to other server behind

    Dear all,
    I get my DC controller server which has crashed. it is server 2008 r2.
    begind it I have an other server which runs virtual machines running TFS and CRM server 2011.
    What is the easier way to get access to my other server as temporary solution for my users ? we have only 3 users.
    I know that I can detached my other server from domaine but then how my users will be able to login the second server by passing the crash DC ?
    Thnaks for your help

    Hi wakefun,
    Thanks for your feedback and sharing. Your time and efforts are highly appreciated.
    Best regards,
    Justin Gu

  • How to use session bean connect to socket server?

    Can any body provice an example for this?
    Thank you.

    Hi,
    You have to catpture the "set-cookie" header from the response which you got in the first request. The same "set-cookie" value has to be set in the subsequent requests' header. Please see the below code snippet to collect the "set-cookie" and set the cookie in the subsequest requests.
    //how to Collect the "set-cookie" from the response
    if (urlConnection != null)
    for (int i = 1;(key = urlConnection.getHeaderFieldKey(i)) != null; i++)
    System.out.println(urlConnection1.getHeaderFieldKey(i) + ": " + urlConnection.getHeaderField(key));
    if (key.equalsIgnoreCase("set-cookie"))
    String cookiValue = urlConnection1.getHeaderField(key);
    //How to set the cookie value in the subsequent requests
    urlConnection2.setRequestProperty("Cookie", cookiValue);
    Good luck.

  • Problem with server behind router

    Hey there,
    I'm working on a small chatting application which performs pretty well when connecting to a server on the same local network, but not-so-well when it's connecting to a server behind a router that's not on the same network.
    Is there any way to get past this problem without using port forwarding? I'd try using that, if it weren't for the fact that the router in question didn't come with any software for configuring it.
    I've looked around for a fix to this problem for a while, but I still haven't managed to find anything. Any ideas?
    The chat program uses ObjectInput/Output streams to send data between the client and server.

    Without port forwarding on the router, your options are a bit limited. You'll probably need a central server to act as a go-between, or at least a rendez-vous point.
    But doesn't your router have an HTML interface? What make and type is it? A manual should be easy to find online, if you don't have a printed version.

  • Chat Applet locks up when connected to a server

    Hey, I am making a chat applet to reach out to IRC like servers. The problem I'm having is when it connects the program locks up till the server disconnect, then it prints the spool into my JTextArea.
    Now, and more bazaar, is that I cannot find a single instructor on the grounds of my tech school who can help me with networking java when 4 people teach in the damn format. Naturally, I'm very frustrated. Any help would be appreciated.

    The full code is at: [http://pastebin.com/m49fe14be|pastebin.com/m49fe14be]
    Naturally I'll be changing this again at least once when I figure out how to play this out.
    Where I'm having problems is: #
            public void connectOut(){
                    try{
                            connectionAddr = InetAddress.getByName(server);
                            connect = new Socket(server, port);
                            initiateReadWrite();
                            //threadRun();
                            //listener = new Thread();
                            //listener.start();
                            //while(listener.isAlive()){
                            readFromServer();
                            connect.setKeepAlive(true);
                    catch(Exception e){
                            exceptioner(e);
            }Or
            public synchronized void readFromServer(){
                    try{
                            String readin;
                            while((readin = in.readLine()) != null){
                                    scrolledText.append(readin + "\n");
                    catch(Exception e){
                            exceptioner(e);
                    }I'm utterly lost and cannot find anyone to help me at my technical college. Four instructors and not a one understands threading.

  • Connection Problem while client is behind proxy and server out side proxy

    hello
    i implemented ChatApplication in JAVA, for that i used socket connection when client and server both are in same network then it's working fine.
    but when my server is on internate and client is behind proxy and try to connect with server
    it not able to connect i get exception.
    i serch most of forum i got same answer and i try it but i was not success.
    any kind of help is appriciated.
    i attached my code(which i implement for testing ) pls reply me
    thanks in advance.
    Server.java
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    class Server {
       public static void main(String args[]) {
          String data = "you are successfully connected with server.";
          try {
             ServerSocket srvs = new ServerSocket(1234);
             Socket skt = srvs.accept();
             System.out.print("Server has connected!\n");
             PrintWriter out = new PrintWriter(skt.getOutputStream(), true);
             System.out.print("Sending string: '" + data + "\n");
             out.print(data);
             out.close();
             skt.close();
             srvs.close();
          catch(Exception e) {
             System.out.print("Whoops! It didn't work!\n");
    ProxyClient.java
    import java.io.*;
    import java.net.*;
    import java.util.*;
    class ProxyClient{
       public static void main(String args[]) {
         String host="61.17.212.29";
         int port=1234;
               String line;
         Properties properties = System.getProperties();
         /*properties.put("firewallSet", "true");
         properties.put("firewallHost", "192.168.0.1");
         properties.put("firewallPort", "808");*/
         properties.put("socksProxySet","true");
         properties.put("socksProxyHost", "192.168.0.1");
         properties.put("socksProxyPort", "1080");
         System.setProperties (properties);
         try {
         /*SocketAddress addr = new InetSocketAddress("192.168.0.1", 1080);
         Proxy proxy = new Proxy(Proxy.Type.SOCKS, addr);
         Socket skt = new Socket(proxy);
         InetSocketAddress dest = new InetSocketAddress("61.17.212.29",1234);
         skt.connect(dest);*/
             System.out.println("before socket taken");
             Socket skt = new Socket(host,port);
             System.out.println("after socket taken");
             BufferedReader networkBin = new BufferedReader(new InputStreamReader(skt.getInputStream()));
             System.out.println("Received string: '");
             line = networkBin.readLine();     // Read one line
          while(true)
                 System.out.println(line);     // Output the line
                 line = networkBin.readLine(); // Read the next line, if any
          catch(Exception e) {
             System.out.print("Whoops! It didn't work!\n");
         e.printStackTrace();
    }

    Now look here. I could not care less about this
    code. I don't know anything about it, I don't
    want to know, I have already recommended you don't
    use it, and I have also given you a simpler and
    better solution. If you don't want to take my advice
    that is your privilege and your problem.ya i has understand system propertis i have setted and u can see it in the code i have tried by both system properties and also J2SE 5.0 proxy class but i got a same problem malformed Exception server refuse to connection.
    is there any problem at sever side?
    can u tell me in which way u r teling to set the propery i m looking forward for ur reply.
    ya i m sure u will give me.................reply "ejp".
    Thnx in advance.

  • Creating java sockets behind proxy servers.

    Hi,
    I am trying to create a socket to an external server(i.e. a public server) from behind a proxy firewall, but the socket creation statement throws an IO exception. Can someone please let me know how to create sockets using proxy servers.
    TIA
    Shishir

    I tried using java.net.Proxy for the connection. But the socket to the proxy itself is not getting created. It throws the IllegalArgumentException.
    import java.io.*;
    import java.net.*;
    import java.net.Proxy.Type;
    public class Client {
    static Socket proxSocket = null;
    static PrintWriter out = null;
    static BufferedReader in = null;
    public static void main(String[] args) throws IOException {    
    try {
    System.out.println("Trying to create socket");
    InetSocketAddress proxyadd = new InetSocketAddress(InetAddress.getByName("148.87.19.20"),80);
    Proxy ps = new Proxy(Proxy.Type.HTTP,proxyadd);
    Socket proxSocket = new Socket(ps);
    out = new PrintWriter(proxSocket.getOutputStream(), true);
    in = new BufferedReader(new InputStreamReader(
    proxSocket.getInputStream()));
    } catch (UnknownHostException e) {
    System.err.println("Don't know about host: ...");
    System.exit(1);
    } catch (IOException e) {
    System.err.println("Couldn't get I/O for "
    + "the connection to: ...");
    System.exit(1);
    catch(IllegalArgumentException e)
    System.err.println("Unable to describe the proxy.");
    System.exit(1);
    }

  • Connection timeout when using iPlanet web-server uses Weblogic 6.1 proxy server to proxy requests to an HTTP server

    Hi all,
    My configuration is as follows: I have an iPlanet web-server that uses a WebLogic
    6.1 (sp1) server to proxy requests to another HTTP server. The HTTP request runs
    for 120 seconds. This causes Weblogic to timeout after a while. The error I get
    is as follows:
    <Aug 25, 2003 3:37:09 PM GMT+00:00> <Warning> <HttpClient> <Couldn't open connection
    java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
    at java.net.Socket.<init>(Socket.java:273)
    at java.net.Socket.<init>(Socket.java:127)
    at weblogic.net.http.HttpClient.openServer(HttpClient.java:194)
    at weblogic.net.http.HttpClient.openServer(HttpClient.java:254)
    at weblogic.net.http.HttpClient.<init>(HttpClient.java:117)
    at weblogic.net.http.HttpClient.New(HttpClient.java:149)
    at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:109)
    at com.db.gmr.dcm.DebtIssueServlet.getVectorFromConnection(DebtIssueServle
    t.java:285)
    at com.db.gmr.dcm.IssuesUSThread.run(IssuesUSThread.java:29)
    >
    I get the same error when I added the following plug-in configuration parameters
    (in obj.conf):
    ConnectTimeoutSecs="170" ConnectRetrySecs="170".
    What do I need to do to extend this timeout? Any help you can provide will be
    greatly appreciated..
    Thanks
    Manish

    Hi all,
    My configuration is as follows: I have an iPlanet web-server that uses a WebLogic
    6.1 (sp1) server to proxy requests to another HTTP server. The HTTP request runs
    for 120 seconds. This causes Weblogic to timeout after a while. The error I get
    is as follows:
    <Aug 25, 2003 3:37:09 PM GMT+00:00> <Warning> <HttpClient> <Couldn't open connection
    java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
    at java.net.Socket.<init>(Socket.java:273)
    at java.net.Socket.<init>(Socket.java:127)
    at weblogic.net.http.HttpClient.openServer(HttpClient.java:194)
    at weblogic.net.http.HttpClient.openServer(HttpClient.java:254)
    at weblogic.net.http.HttpClient.<init>(HttpClient.java:117)
    at weblogic.net.http.HttpClient.New(HttpClient.java:149)
    at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:109)
    at com.db.gmr.dcm.DebtIssueServlet.getVectorFromConnection(DebtIssueServle
    t.java:285)
    at com.db.gmr.dcm.IssuesUSThread.run(IssuesUSThread.java:29)
    >
    I get the same error when I added the following plug-in configuration parameters
    (in obj.conf):
    ConnectTimeoutSecs="170" ConnectRetrySecs="170".
    What do I need to do to extend this timeout? Any help you can provide will be
    greatly appreciated..
    Thanks
    Manish

Maybe you are looking for