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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:22:57+00:00 2026-05-31T10:22:57+00:00

Given an ssh tunnel created on machine A to machine B using e.g. ssh

  • 0

Given an ssh tunnel created on machine A to machine B using e.g.

ssh -D 9999 user@remote-server-ip-machine-B

In php how would one make requests from machine A to machine C using stream_socket_client() such that those requests are made via the above tunnel e.g.

$socket = stream_socket_client("tls://$ip-machine-C:$port", $errno,$errstr, 60, STREAM_CLIENT_CONNECT, $context);

In other words, the requests must originate from a php script running on machine A made to machine C but to machine C the requests must look like they are coming from machine B (the connection made to machine C needs to be made using tls).

Or alternatively, is there a way to achieve the same end result directly in php without the ssh tunnel? Any help with this will be very much appreciated

  • 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-31T10:22:58+00:00Added an answer on May 31, 2026 at 10:22 am

    I found the best way to solve this problem is to use a VPN like OpenVPN (connecting machine A to machine B) or a very useful script called sshuttle, which is a transparent proxy server that works as a poor man’s VPN.

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

Sidebar

Related Questions

I am using Net::SSH::Perl to execute a command on a remote server as follows:
I am using ssh tools to make a ssh connection to a school server,
I am using java ssh tools to make an ssh connection to my school
I'm running a Mac OS X Leopard Server and I created a new user
I am trying to connect to a remote MySql server from my local machine.
Situation: I've been given SSH access to a server running LAMP (Redhat) and the
I need to allow a PHP script on my local web server, to SSH
Among FTP, HTTP, SSH, etc. and given a consistent, broadband internet connection what is
Been back and forth on this recently. Trying to attach a SSH tunnel from
Given a username and password, I need to check if there's a user on

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.