ITstudy

ํ•ด์ปค๋Š” ์•„๋‹ˆ์ง€๋งŒ ํด๋ผ์ด์–ธํŠธ ์ •๋ณด๋ฅผ ์•Œ์ˆ˜์žˆ๋Š” User-Agent ๊ฐœ๋…

martinooo 2024. 12. 2. 16:58

User-Agent ๊ฐœ๋…

 

 

 

๐Ÿคท‍โ™‚๏ธ User-Agent๋ž€?


์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ๊ฐ€ ํ†ต์‹ ์„ ํ•  ๋•Œ ๋‚ด๊ฐ€ ๋ˆ„๊ตฌ์ธ์ง€ ์‹๋ณ„ํ•˜๊ธฐ ์œ„ํ•ด HTTP ์š”์ฒญ ํ—ค๋”์— ๋‹ค์–‘ํ•œ ์ •๋ณด๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.

์ด ์ •๋ณด๋Š” ์ž„์˜๋กœ ์ˆ˜์ •์ด ๋ ์ˆ˜ ์—†๊ณ  ๋ณดํ†ต ์ด์ƒํ•œ ์š”์ฒญ์ด๋‚˜ HTTP ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์„ ๋•Œ ์‚ฌ์šฉ์ž ์ •๋ณด์™€ ํ™˜๊ฒฝ์„ ์•Œ์•„๋ณด๊ธฐ ์œ„ํ•ด์„œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

 

ํฌ๋กฌ(Chrome) ๋ธŒ๋ผ์šฐ์ €์˜ User-Agent๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.5735.110 Safari/537.36

 

User-Agent์˜ ๊ตฌ์กฐ

  • ํ”Œ๋žซํผ ์ •๋ณด: ์šด์˜์ฒด์ œ ์ •๋ณด๊ฐ€ ๋“ค์–ด๊ฐ€๋ฉฐ ์˜ˆ๋ฅผ ๋“ค์–ด Windows NT 10.0, Macintosh, Linux ๋“ฑ์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.
  • ๋ธŒ๋ผ์šฐ์ € ์ •๋ณด: ๋ธŒ๋ผ์šฐ์ €์˜ ์ข…๋ฅ˜์™€ ๋ฒ„์ „์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด Chrome/114.0.5735.110์™€ ๊ฐ™์€ ํ˜•ํƒœ๋กœ ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.
  • ๋ Œ๋”๋ง ์—”์ง„ ์ •๋ณด: HTML์„ ๋ Œ๋”๋งํ•˜๋Š” ์—”์ง„์— ๋Œ€ํ•œ ์ •๋ณด๊ฐ€ ๋“ค์–ด๊ฐ‘๋‹ˆ๋‹ค. AppleWebKit ๋˜๋Š” Gecko ๋“ฑ์ด ํฌํ•จ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๊ฐ๊ฐ ๋ธŒ๋ผ์šฐ์ €๋งˆ๋‹ค ๋‹ค๋ฅธ ๋ฐฉ์‹์˜ User-Agent ๊ตฌ์กฐ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์ง€๋งŒ ์ „์ฒด์ ์ธ ๊ฐœ๋…์€ ๋˜‘๊ฐ™์Šต๋‹ˆ๋‹ค.

 

๊ฐ๊ฐ ๋ธŒ๋ผ์šฐ์ €์˜ User-Agent ๊ตฌ์กฐ ๋ฌธ์„œ

https://developer.mozilla.org/ko/docs/Web/HTTP/Headers/User-Agent

 

User-Agent - HTTP | MDN

์‚ฌ์šฉ์ž ์—์ด์ „ํŠธ ์š”์ฒญ ํ—ค๋”๋Š” ์„œ๋ฒ„์™€ ๋„คํŠธ์›Œํฌ ํ”ผ์–ด๊ฐ€ ์š”์ฒญํ•˜๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜, ์šด์˜์ฒด์ œ, ์ œ์กฐ์—…์ฒด, ์‚ฌ์šฉ์ž ์—์ด์ „ํŠธ ์š”์ฒญ ๋ฒ„์ „์„ ์‹๋ณ„ํ•˜๋Š” ๋…ํŠนํ•œ ๋ฌธ์ž์—ด์ž…๋‹ˆ๋‹ค.

developer.mozilla.org

 

๐Ÿคท‍โ™‚๏ธ User-Agent ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•


 

  • User-Agent ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ํ™œ์šฉ:
    • JavaScript๋‚˜ Python ๋“ฑ์˜ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์—๋Š” User-Agent ํŒŒ์‹ฑ์„ ์œ„ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ํ†ตํ•ด User-Agent ๋ฌธ์ž์—ด์„ ํŒŒ์‹ฑ ํ•˜์—ฌ ์šด์˜์ฒด์ œ, ๋ธŒ๋ผ์šฐ์ € ์ข…๋ฅ˜, ๋ฒ„์ „ ๋“ฑ์˜ ์ •๋ณด๋ฅผ ์†์‰ฝ๊ฒŒ ์–ป์–ด์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • API ๊ฐœ๋ฐœ ์‹œ User-Agent ์ฒดํฌ:
    • API์— ์ ‘๊ทผํ•˜๋Š” ํด๋ผ์ด์–ธํŠธ๋ฅผ ๋ถ„๋ฅ˜ํ•˜๊ฑฐ๋‚˜ ๊ด€๋ฆฌํ•  ๋•Œ User-Agent๋ฅผ ํ™œ์šฉํ•˜์—ฌ ๋ชจ๋ฐ”์ผ ์•ฑ, ์›น ๋ธŒ๋ผ์šฐ์ €, ๊ธฐํƒ€ ์„œ๋ฒ„ ๊ฐ„ ํ†ต์‹  ๋“ฑ ์š”์ฒญ์˜ ์ถœ์ฒ˜๋ฅผ ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ์˜๋„ํ•˜์ง€ ์•Š์€ ํด๋ผ์ด์–ธํŠธ์˜ ์ ‘๊ทผ์„ ์ฐจ๋‹จํ•˜๊ฑฐ๋‚˜ ์ œํ•œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ๋ธŒ๋ผ์šฐ์ € ํ˜ธํ™˜์„ฑ ํ…Œ์ŠคํŠธ:
    • ๋‹ค์–‘ํ•œ ๋ธŒ๋ผ์šฐ์ €์—์„œ ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์ •์ƒ ๋™์ž‘ํ•˜๋Š”์ง€ ํ…Œ์ŠคํŠธํ•˜๋Š” ๊ฒฝ์šฐ, User-Agent ์Šคํ‘ธํ•‘์„ ํ†ตํ•ด ํ™˜๊ฒฝ์„ ๋ณ€๊ฒฝํ•˜๋ฉฐ ํ…Œ์ŠคํŠธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์—์„œ ๊ฐ๊ธฐ ๋‹ค๋ฅธ ๋ธŒ๋ผ์šฐ์ € ํ™˜๊ฒฝ์„ ์‹œ๋ฎฌ๋ ˆ์ด์…˜ํ•˜๊ณ  ํ˜ธํ™˜์„ฑ ๋ฌธ์ œ๋ฅผ ์‚ฌ์ „์— ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

User-Agent ์กฐ์ž‘ํ•ด์„œ ์‹ค์ œ ์‚ฌ์šฉ์ž์ฒ˜๋Ÿผ ์š”์ฒญ์„ ๋ณด๋‚ผ์ˆ˜์žˆ์–ด์„œ User-Agent ์ •๋ณด๋ฅผ 100% ์‹ ๋ขฐํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

 

User-Agent

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ User-Agent ์‚ฌ์šฉ๋ฒ•

const userAgent = navigator.userAgent;

 

navigator.userAgent๋Š” ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์„œ๋ฒ„๋กœ ์ „๋‹ฌํ•˜๋Š” User-Agent ์ •๋ณด๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

 

ํŠน์ • ๋ธŒ๋ผ์šฐ์ € ํ™•์ธํ•˜๋Š” ๋ฐฉ๋ฒ•

if (userAgent.indexOf("Chrome") > -1) {
  console.log("Chrome ๋ธŒ๋ผ์šฐ์ €์—์„œ ์‹คํ–‰ ์ค‘์ž…๋‹ˆ๋‹ค.");
} else if (userAgent.indexOf("Firefox") > -1) {
  console.log("Firefox ๋ธŒ๋ผ์šฐ์ €์—์„œ ์‹คํ–‰ ์ค‘์ž…๋‹ˆ๋‹ค.");
} else if (userAgent.indexOf("Safari") > -1) {
  console.log("Safari ๋ธŒ๋ผ์šฐ์ €์—์„œ ์‹คํ–‰ ์ค‘์ž…๋‹ˆ๋‹ค.");
} else {
  console.log("์ง€์›ํ•˜์ง€ ์•Š๋Š” ๋ธŒ๋ผ์šฐ์ €์ž…๋‹ˆ๋‹ค.");
}

 

๋ชจ๋ฐ”์ผ ๋””๋ฐ”์ด์Šค ํ™•์ธํ•˜๋Š” ๋ฐฉ๋ฒ•

const userAgent = navigator.userAgent;

if (/Mobi|Android|iPhone|iPad/i.test(userAgent)) {
  console.log("๋ชจ๋ฐ”์ผ ๊ธฐ๊ธฐ์—์„œ ์‹คํ–‰ ์ค‘์ž…๋‹ˆ๋‹ค.");
} else {
  console.log("๋ฐ์Šคํฌํƒ‘ ๊ธฐ๊ธฐ์—์„œ ์‹คํ–‰ ์ค‘์ž…๋‹ˆ๋‹ค.");
}

 

์œ„์™€ ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ User-Agent ํšจ์œจ์ ์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค

 

 

์‚ฌ์—… ๋งค์ถœ์„ ๋†’์ด๋Š” ๋žœ๋”ฉํŽ˜์ด์ง€ ์•Œ์•„๋ณด๊ธฐ

https://www.issue-economy.com/post/%EB%9E%9C%EB%94%A9%ED%8E%98%EC%9D%B4%EC%A7%80%EB%9E%80

 

์‚ฌ์—… ๋งค์ถœ์„ ๋†’์ด๋Š” ๋žœ๋”ฉํŽ˜์ด์ง€๋ž€?

๋žœ๋”ฉํŽ˜์ด์ง€๋Š” ๋ฐฉ๋ฌธ์ž๊ฐ€ ํŠน์ • ํ–‰๋™์„ ์ทจํ•˜๋„๋ก ์œ ๋„ํ•˜๋Š” ์›นํŽ˜์ด์ง€๋กœ, ๋งค์ถœ ์ฆ๋Œ€์— ์ค‘์š”ํ•œ ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. ์ด ๊ธ€์—์„œ๋Š” ๋งค์ถœ์„ ๋†’์ด๋Š” ๋žœ๋”ฉํŽ˜์ด์ง€์˜ ์ •์˜, ๊ตฌ์„ฑ ์š”์†Œ, ๊ทธ๋ฆฌ๊ณ  ํšจ๊ณผ์ ์ธ ์ „๋žต์— ๋Œ€

www.issue-economy.com

 

 


 

์žฌ๋ฐŒ๋Š” ์˜ค๋Š˜์˜ ๋ ๋ณ„ ์šด์„ธ ๋ณด๊ณ  ๊ฐ€์„ธ์š”! 

 

 

https://cometruedream.tistory.com/247

 

[React] Tailwind ํ•œ์ค„, ๋‘์ค„, ์„ธ์ค„ ํšจ๊ณผ className ์ปค์Šคํ…€

๐Ÿคท‍โ™‚๏ธ Tailwind ํ•œ์ค„, ๋‘์ค„, ์„ธ์ค„ ํšจ๊ณผํ”„๋กœ์ ํŠธ ์ง„ํ–‰์ค‘ ๋ฐฐ๋„ˆ ๋งํฌ์— URL ๊ธธ์ด๊ฐ€ ๋„ˆ๋ฌด ๊ธธ์–ด์„œ 3์ค„ ํšจ๊ณผ ์ฒ˜๋ฆฌ๋ฅผ ํ•ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค. React + Tailwind CSS ์…‹ํŒ…๋œ ํ”„๋กœ์ ํŠธ ์—ฌ์„œ CSS ํŒŒ์ผ & style ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/243

 

NestJS Lifecycle (์ƒ๋ช…์ฃผ๊ธฐ) ๊ฐœ๋…

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œ Nest JS ๊ฐœ๋…?Nest JS๋Š” Node JS ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ ์„œ๋ฒ„ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ํ”„๋ ˆ์ž„์›Œํฌ ์ž…๋‹ˆ๋‹ค. ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋Š” ์ƒ๋‹นํžˆ ์˜ค๋žซ๋™์•ˆ Express ๊ธฐ๋ฐ˜์œผ๋กœ ์„œ๋ฒ„ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ฐœ๋ฐœ์—์„œ ์••๋„์ ์ธ ์ 

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/242

 

๋ฆฌ์•กํŠธ Vite Proxy ํ™œ์šฉํ•œ CORS ์˜ค๋ฅ˜ ํ•ด๊ฒฐ

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œํ”„๋ก ํŠธ์—”๋“œ ๋ฒˆ๋“ค๋Ÿฌ ๊ฐœ๋…๊ณผ webpack vs vite ๋น„๊ต์— ๋Œ€ํ•ด์„œ ๊ณต๋ถ€๋ฅผ ํ•˜๊ณ  ๊ธ€์„ ๋ณด์‹œ๋ฉด ๋” ๋งŽ์€ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค^^ํ”„๋ก ํŠธ์—”๋“œ ๊ฐœ๋ฐœ์„ ์œ„ํ•œ ๋ฒˆ๋“ค๋Ÿฌ ๊ฐœ๋…๊ณผ webpack vs vite ๋น„๊ตhttps://comet

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/241

 

React ํด๋”๊ตฌ์กฐ FSD ๊ธฐ๋Šฅ ๋ถ„ํ™œ ์„ค๊ณ„ ์•„ํ‚คํ…์ฒ˜

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œํ”„๋กœ์ ํŠธ๋ฅผ ์‹œ์ž‘ํ•˜๊ธฐ์— ์•ž์„œ ํด๋” ๊ตฌ์กฐ, ์„ค๊ณ„์— ๋Œ€ํ•œ ์•„ํ‚คํ…์ฒ˜๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ์€ ์ƒ๋‹นํžˆ ์–ด๋ ต๋‹ค. ์ด๋ฒˆ ํ”„๋กœ์ ํŠธ์— React FSD ํด๋”๊ตฌ์กฐ ์•„ํ‚คํ…์ฒ˜๋ฅผ ์„ค๊ณ„ํ•  ์˜ˆ์ •์ด๋ผ์„œ FSD ์•„ํ‚คํ…

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/244

 

์‰ฝ๊ฒŒ ์ดํ•ดํ•˜๊ณ  ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ๋Š” Prisma ๋ช…๋ น์–ด ์ •๋ฆฌ

๐Ÿคท‍โ™‚๏ธ Prisma ๋ช…๋ น์–ด ๋ณธ๋ก ์— ์•ž์„œ Prisma๋ž€?Nest JS ํ”„๋ ˆ์ž„์›Œํฌ์™€ Prisma ORM์„ ํ™œ์šฉํ•ด์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด์„œ Prisma๋Š” Node JS ๊ธฐ๋ฐ˜์— ํ”„๋ ˆ์ž„์›Œํฌ/๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ์ƒํ˜ธ์ž‘์šฉ์ด ์ž˜๋˜๋ฉฐ Prisma + DB ์—ฐ๋™์œผ

cometruedream.tistory.com

 

 

https://itibiza.tistory.com/entry/%EB%8F%84%EC%BB%A4-%EC%9E%85%EB%AC%B8-%EC%8B%9C%EB%A6%AC%EC%A6%88-Dockerfile-%EA%B0%9C%EB%85%90-%EB%B0%8F-%EC%82%AC%EC%9A%A9%EB%B2%95

 

[๋„์ปค ์ž…๋ฌธ ์‹œ๋ฆฌ์ฆˆ] Dockerfile ๊ฐœ๋… ๋ฐ ์‚ฌ์šฉ๋ฒ•

์ด ๊ธ€์—์„œ๋Š” ์ž…๋ฌธ์ž๋ฅผ ์œ„ํ•œ ๋„์ปค ์‹œ๋ฆฌ์ฆˆ๋กœ ๋„์ปค ์ž…๋ฌธ ์‹œ๋ฆฌ์ฆˆ - Dockerfile ๊ฐœ๋… ๋ฐ ์‚ฌ์šฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค. ์•ˆ๋…•ํ•˜์„ธ์š”! ITibiza ์ž…๋‹ˆ๋‹ค. ์ด์ „ ๊ธ€์—์„œ ๋„์ปค ์ด๋ฏธ์ง€, ์ปจํ…Œ์ด๋„ˆ์˜ ๊ฐœ๋…๊ณผ ๋„์ปค

itibiza.tistory.com