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

  • Home
  • SEARCH
  • 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 7537397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:50:28+00:00 2026-05-30T06:50:28+00:00

I need to establish a Socket connection (TCP) between two hosts (say host1 and

  • 0

I need to establish a Socket connection (TCP) between two hosts (say host1 and host2) in Java. But looks like I can’t do that because of a firewall. Though there’s a third host (say host3) which is accessible from both host1 and host2 and I think can be used as an intermediate for this connection.

So basically, I want to send a request from host1 (client) to host3, which redirects my request to host2 (server).

Could you please let me know how can this be achieved?

Thanks in advance!

  • 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-30T06:50:29+00:00Added an answer on May 30, 2026 at 6:50 am

    You could establish a SSH tunnel with

    ssh host3 -L4321:host2:6523
    

    and then connect from host1 to host3 on port 4321. This effectively gets redirected to port 6523 on host2.


    A similiar option could be to have ssh provide a SOCKS server.

    ssh host3 -D 6543
    

    and then use curl instead of wget.

    Then you can do

    curl http://host2/foo/bar --socks4 localhost:6543
    

    (untested, --socks4a and --socks5 could be an option as well…)

    This ssh command creates a SOCKS server locally which tunnels the connection attempts to the ssh server, which in turn executes them.

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

Sidebar

Related Questions

I need to establish a P2P UDP and TCP Connection between two Users. Both
I need to implement tcp socket communication between server and iOS client. I am
I need to establish the Connection with MailServer (Custom Mail server). Whenever I tried
I want to establish socket connection to streaming server (with iphone ) and want
I have two tables and I need to establish a 1-many relation among them,
I need to be able to establish an ODBC connection through SQL Server authentication.
Need a function like: function isGoogleURL(url) { ... } that returns true iff URL
OS: Ubuntu Linux 10.10 Kernel: 2.6.35-30 Query: I need to establish a robust communication
We have come across two apps made on google app engine (java) and we
I'm testing Synapse and want to know how can I establish a secure connection.

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.