이전 포스팅의 프로젝트에서 수정 ( https://sangjunui.tistory.com/16 )
해당 프로젝트는 localhost 동작으로 한 PC 내에서 보내고 받았다.
본 포스팅은 [ Client ] - [ 외부망 ] - [ Server ] 로 구현하려하며
외부망 구현은 iptime , DDNS 기능을 사용함 ( 추후 포스팅 예정 )

1. iptime 포트포워딩에서 서버 ip / port 설정
( ex ,192.168.150 / 11116 )

2. Server 부분 ipaddr 을 공유기에서 전달받은 ip 사용
const ipaddr = '192.168.0.150';
const port = 11116;
3. Client 부분 연결 부분 DNS / Port 입력
const client = net.connect({ port: 11116, host: "testDNS.iptime.org" });
issue ) Client에서 보낼때 해당 dns 의 address는 받아오나 timeout 등의 응답없음이 뜬다면 방화벽 문제일 확률이 크다.
events.js:377
throw er; // Unhandled 'error' event
^
Error: connect ETIMEDOUT ip:port
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -4039,
code: 'ETIMEDOUT',
syscall: 'connect',
address: 'ip',
port: port
}
'Server > 개발' 카테고리의 다른 글
| [Node.js] HEX array parsing (0) | 2022.04.14 |
|---|---|
| [Node.js] UTF8 / Hex 값 송수신 (0) | 2022.04.14 |
| [Node.js] 문자열 만들기 ( split() ) , 배열 수 , 배열 길이 구하기 (0) | 2022.04.11 |
| [Node.js] 시간 설정 ( timezone ) 관련 (0) | 2022.04.11 |
| [Node.js] VSCode 설치 및 프로젝트 생성 (0) | 2022.04.06 |