이 콘텐츠는 선택한 언어로 제공되지 않습니다.
11.15.2. Application Port Forwarding
Configure port forwarding for an application with the following command, ensuring the application is running before doing so:
rhc port-forward App_Name
$ rhc port-forward App_Namerhc port-forward App_Name
Example 11.20. Configuring Port Forwarding for an Application
With port forwarding configured, access the remote application with a browser using the local ports.
The current implementation of the
rhc port-forward
command forwards all open ports on a running application to your local workstation. If an application contains multiple cartridges, the command output shows which remote services are being bound to local ports.
Specific ports are forwarded with the following command. Specify the local port and remote port as required, as well as the gear ID, and application and domain name of the remote port:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
ssh -L local_port:host:remote_port gear_ID@app-domain.example.com
$ ssh -L local_port:host:remote_port gear_ID@app-domain.example.comssh -L local_port:host:remote_port gear_ID@app-domain.example.comssh -L local_port:host:remote_port gear_ID@app-domain.example.comssh -L local_port:host:remote_port gear_ID@app-domain.example.comssh -L local_port:host:remote_port gear_ID@app-domain.example.comssh -L local_port:host:remote_port gear_ID@app-domain.example.comssh -L local_port:host:remote_port gear_ID@app-domain.example.comssh -L local_port:host:remote_port gear_ID@app-domain.example.comssh -L local_port:host:remote_port gear_ID@app-domain.example.comssh -L local_port:host:remote_port gear_ID@app-domain.example.com
Example 11.21. Forwarding Specific Ports
ssh -L 8080:localhost:8080 70277280b8534c8a9fc76d2734393dfa@racer-auto.example.com
$ ssh -L 8080:localhost:8080 70277280b8534c8a9fc76d2734393dfa@racer-auto.example.com
This example allocates a socket to listen to the local port host 8080. When a connection to this port is made, a secure channel forwards the connection to the remote host port 8080.