ssh tunnel connection interface machine (port forwarding to local)

Scenes:

   When working on the Ningxia project, you need to call the third-party interface, but the third-party interface has no public network only, and you can only deploy the program to the springboard every time.

The springboard is calling our interface machine (there is no public IP), I put the interface to call the third-party interface and encapsulate the interface, and then respond to the application on the springboard.

This is obviously very inefficient. In order to allow the interface program on Eclipse on my computer, I can directly connect to the third-party interface.

need:

     Local eclipse joint debugging interface

Network element equipment:

     Springboard machine (with public IP), our interface machine (without public IP), and the other interface machine (without public IP).

      Note: These servers are all in the same computer room

 

Description: Formal development is the deployment of applications on the springboard, and the interface machine is responsible for the application on the springboard, requesting the request and response of the other party's interface.

 

Step 1: Now execute the command on the springboard

nohup ssh -gNL 2280:135.193.34.22:8080 [email protected] -p 5085 &

 

 Step 2: Prompt to enter a password, press Enter directly here, the effect after entering is as follows

 

Step 3: After the carriage return in the second step, enter fg

 



 

Enter the login password of the logquery user here.

 

 

the fourth step:

     

In secureCRT, select the connection, right-click->Properties->port Forwarding->add



 

 

 Step 5: Enter the port in the pop-up box of Step 4. The port number is a port that was randomly input in Step 1.

 

 
Step 6: Test


 Open cmd.exe locally and enter

 

 

 Step 7: Modify the request address modification in eclipse

 



 end:

   The local eclipse can call the other interface

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326257276&siteId=291194637