기타 개발 관련

로컬 호스트 다른 컴퓨터에서 접속하는 방법 (무료)

9yeah 2022. 2. 15. 17:20

** localhost 접속 가능하게 웹서버(아파치) 켜져 있어야 함 **

방법 3 추천합니다!

 

방법 1) (시간제한 있음, 변동주소)
1. localhost.run 홈페이지 접속

https://localhost.run/ 

 

localhost.run | localhost.run

Connect web applications running on your computer to the internet instantly

localhost.run

2. cmd 창에 붙여넣기

ex) 80번 포트 연결시,

ssh -R 80:localhost:80 nokey@localhost.run

 

3. 마지막 줄에 출력된 주소 복사

4. 다른 컴퓨터의 인터넷 창에 붙여넣기

 

방법 2) (시간제한 있음, 변동주소)
1. ngrok 홈페이지 접속하여 로그인

https://ngrok.com/

 

ngrok - secure introspectable tunnels to localhost

@Botto ngrok, probably the best tool I have started to use for my webwork since firebug also great support

ngrok.com

2. Authtoken 발급

3. ngrok 프로그램 실행 후

ngrok authtoken [your Authtoken]
ngrok.exe http 80 

 

4. Forwarding에 있는 주소 복사 후 사용

 

방법 3) (시간제한 있음, 고정주소)

1. localtunnel 설치

sudo apt install npm
sudo npm install -g localtunnel

2. cmd 창에 입력

lt --port [포트번호] --subdomain [도메인 이름] --print-requests

 

 

3. your url is : ~~~~~~~~~~~~~~~ 부분 복사해서 사용

 

** 주기적으로 재실행 해줘야 함 **