전체 글 315

TypeScript 언어 정리

1. Java, TypeScript(정적 언어) 컴파일 시점에 타입 결정하고 그때 오류 발견한다. (JavaScript : 런타임 시점에 타입 오류 확인 가능) 타입 설정하지 않으면 타입스크립트는 any로 설정함. function add(num1:number, num2:number){ console.log(num1 + num2); } add(1,2); // 3 add(); // NaN = undefined + undefined function showItems(arr:string[]){ arr.forEach((item) => { console.log(item); }); } showItems(['1','2','3']) // 1 2 3 2. 타입 지정 let age:number = 30; let isAdul..

네트워크 주요 기술

1. DHCP : IP를 동적으로 할당하는 데 사용되는 프로토콜이 DHCP(Dynamic Host Configuration Protocol)이다. DHCP를 사용하면 사용자가 직접 입력해야 하는 IP주소, 서브넷 마스크, 게이트웨이, DNS 정보를 자동으로 할당받아 사용할 수 있다. DHCP는 서버와 클라이언트로 동작하며 클라이언트의 서비스 포트는 68 서버의 서비스 포트는 67이다. DHCP는 BOOTP라는 프로토콜을 기반으로 한다. 2. DHCP 동작방식 호스트가 DHCP 서버로 IP를 할당받는 과정은 4단계로 진행된다. 1) DHCP Discover : DHCP 클라이언트는 DHCP 서버를 찾기 위해 DHCP Discover 메시지를 브로드캐스트로 전송한다. 2) DHCP Offer : DHCP D..

프론트는 https로 서비스, apiserver는 http 프로토콜일 경우

오류 : Mixed Content: The page at 'https://domain.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://111.111.111.111:7080/api/svc/v2/projectList?page=1'. This request has been blocked; the content must be served over HTTPS. 해결 : 2번으로 해결 (nginx.conf에서 reverse proxy 설정함) The error message you're seeing, "Mixed Content," indicates that your web page was loaded over..

CS/Network 2023.09.19

파일 다운로드, 파일 업로드 API 구현 시 보안 상 유의점

1. 파일 다운로드 Directory Traversal Attacks: Attackers might attempt to traverse directories by manipulating the fileName parameter. To prevent this, you should validate and sanitize the fileName parameter to ensure it only points to files within the designated storage directory. Authentication and Authorization: Implement proper authentication and authorization mechanisms to ensure that only authori..

Rate Limiting Mechanism

Spring Boot REST API to prevent users from making too many requests within a short period of time 서버가 제공할 수 있는 자원에는 제한이 있기 때문에 안정적으로 서비스를 제공하기 위해 예를 들어api 호출횟수를 1분당 60회로 제한하고, 60회를 넘어서는 순간 요청을 처리하지 않고 리턴한다. 이를 Throttling이라고도 한다. Rate Limit가 필요한 사례 1. 서비스의 안정성 및 성능보장 : 서버가 다운되는 등의 사고를 미연에 방지하기 위해 2. 서비스의 가용성 확보 : 과도한 트래픽으로부터 서비스를 보호 3. 보안 : 로그인, 프로모션 코드와 같이 보안적으로 중요한 기능을 brute force attck으로부터 보호한..

nohup 과 &, 리눅스 백그라운드 실행

1. nohup, &이란 리눅스를 사용할 때 백그라운드에서 세션과의 연결이 끊어져도 프로세스를 돌려야 하는 경우 사용하는 명령어가 nohup과 & 명령어이다. putty나 cmd를 통한 ssh로 서버와 연결했을 때 세션을 끊어도 해당 프로세스를 백그라운드에서 돌릴 수 있다는 말이다. * nohup = no hang up = 끊지 말라는 것 nohup yarn start nohup을 이렇게 실행시키면 nohup: appending output to `nohup.out` 메세지와 함께 nohup을 실행시킨 경로에 nohup.out 파일이 생성된다. 다른 파일에 출력하려면 아래와 같이 // 다른 파일에 출력을 할 경우 nohup yarn start > nohup_script.out // 출력 내용이 필요하지 ..

React.js와 Vue.js가 등장하게 된 배경, 기존 JSP같은 server-side-redering과의 차이점

제대로 알고 쓰자 1. 등장배경 Front-end frameworks like Vue.js and React.js have arisen primarily to address the challenges and complexities of building modern web applications. These frameworks provide a structured and efficient way to manage the user interface (UI) of web applications. Here are some reasons why these frameworks have become popular: User Experience Demands: Modern web applications require ..