이 콘텐츠는 선택한 언어로 제공되지 않습니다.

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_Namerhc port-forward App_Name
Copy to Clipboard Toggle word wrap

Example 11.20. Configuring Port Forwarding for an Application

$ rhc port-forward myapp
Checking available ports ... done
Forwarding ports ...
Address already in use - bind(2) while forwarding port 8080. Trying local port 8081
Address already in use - bind(2) while forwarding port 8080. Trying local port 8081
Address already in use - bind(2) while forwarding port 8081. Trying local port 8082

To connect to a service running on OpenShift, use the Local address

Service Local                OpenShift
------- --------------- ---- -------------------------------------------------------
haproxy 127.0.0.1:8080   =>  127.9.159.130:8080
haproxy 127.0.0.1:8081   =>  127.9.159.131:8080
httpd   127.0.0.1:8082   =>  127.9.159.129:8080
mysql   127.0.0.1:50226  =>  52347a1d2587c86695111697-mydomain.rhcloud.com:50226

Press CTRL-C to terminate port forwarding
Copy to Clipboard Toggle word wrap
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:
$ 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
Copy to Clipboard Toggle word wrap

Example 11.21. Forwarding Specific Ports

$ ssh -L 8080:localhost:8080 70277280b8534c8a9fc76d2734393dfa@racer-auto.example.com
Copy to Clipboard Toggle word wrap
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.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat