网络协议术语词典

全面的网络协议术语参考,帮助开发者快速理解和查阅核心概念

60
总术语数
7
分类
60+
示例
,其他用户查看时执行。" }, { name: "CSRF", pronunciation: "/ˌsiːˌɛsˈɑːrf/", category: "security", definition: "跨站请求伪造(Cross-Site Request Forgery),诱导用户在已认证的网站上执行非预期操作。", example: "示例:恶意网站诱导用户点击,向银行发送转账请求。" }, { name: "GraphQL", pronunciation: "/ˌɡræfˌkjʊəl/", category: "application", definition: "Facebook 开发的查询语言和运行时,允许客户端精确请求所需数据,避免过度获取和欠获取。", example: "示例:query { user(id: 123) { name email } } 只获取 name 和 email 字段。" }, { name: "gRPC", pronunciation: "/ˌɡiːˌɑːrˌpiːˈsiː/", category: "application", definition: "Google 开发的高性能 RPC 框架,使用 HTTP/2 传输和 Protocol Buffers 序列化。适用于微服务通信。", example: "示例:微服务之间使用 gRPC 进行高效通信,支持双向流。" }, { name: "OAuth 2.0", pronunciation: "/ˌoʊˈɑːθ/", category: "security", definition: "开放授权标准,允许第三方应用有限访问用户资源,而无需共享密码。广泛用于单点登录(SSO)。", example: "示例:使用 Google 账号登录第三方网站,授权访问基本信息。" }, { name: "JWT", pronunciation: "/dʒɒt/", category: "security", definition: "JSON Web Token,一种紧凑的、自包含的令牌格式,用于在各方之间安全传输信息。由头部、载荷、签名三部分组成。", example: "示例:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U。" }, { name: "SOAP", pronunciation: "/soʊp/", category: "application", definition: "简单对象访问协议(Simple Object Access Protocol),基于 XML 的协议,用于 Web 服务通信。比 REST 更正式和严格。", example: "示例:SOAP 消息使用 XML 格式,包含 Envelope、Header、Body。" }, { name: "Webhook", pronunciation: "/ˈwɛbˌhʊk/", category: "application", definition: "一种回调机制,允许应用程序向其他应用程序提供实时信息。当事件发生时,源应用向目标 URL 发送 HTTP 请求。", example: "示例:GitHub 在代码推送时向指定 URL 发送 Webhook 通知。" }, { name: "长轮询", pronunciation: "", category: "application", definition: "一种模拟服务器推送的技术。客户端发送请求,服务器保持连接直到有数据或超时,然后客户端立即发送新请求。", example: "示例:聊天应用在 WebSocket 不可用时的降级方案。" }, { name: "Server-Sent Events", pronunciation: "", category: "application", definition: "服务器发送事件(SSE),允许服务器向浏览器推送更新。单向通信(服务器→客户端),基于 HTTP。", example: "示例:新闻推送、股票行情、社交媒体通知使用 SSE。" }, { name: "QUIC", pronunciation: "/kwɪk/", category: "http", definition: "快速 UDP 网络连接(Quick UDP Internet Connections),Google 开发的基于 UDP 的传输协议,HTTP/3 的基础。减少连接建立延迟。", example: "示例:HTTP/3 使用 QUIC 协议,0-RTT 连接建立,支持多路复用无队头阻塞。" }, { name: "HTTP/2", pronunciation: "", category: "http", definition: "HTTP 协议的第二版,引入多路复用、头部压缩、服务器推送等特性,显著提升性能。", example: "示例:HTTP/2 在同一连接上并行传输多个请求,减少延迟。" }, { name: "HTTP/3", pronunciation: "", category: "http", definition: "HTTP 协议的第三版,基于 QUIC 协议(UDP),解决 TCP 队头阻塞问题,进一步提升性能和可靠性。", example: "示例:HTTP/3 在弱网络环境下表现更好,连接迁移支持无缝切换网络。" }, { name: "Keep-Alive", pronunciation: "", category: "http", definition: "HTTP 持久连接,允许在单个 TCP 连接上发送多个 HTTP 请求/响应,减少连接建立开销。", example: "示例:Connection: keep-alive 保持连接,复用 TCP 连接传输多个请求。" }, { name: "缓存", pronunciation: "", category: "http", definition: "存储数据副本以便快速访问的机制。HTTP 缓存包括浏览器缓存、代理缓存、服务器缓存。", example: "示例:Cache-Control: max-age=3600 指示浏览器缓存 1 小时。" }, { name: "ETag", pronunciation: "/ˈiːˌtæɡ/", category: "http", definition: "实体标签,资源的唯一标识符。用于缓存验证,如果资源未变化,服务器返回 304 Not Modified。", example: "示例:If-None-Match: \"abc123\" 客户端发送 ETag,服务器验证是否变化。" }, { name: "Content-Type", pronunciation: "", category: "http", definition: "指示资源媒体类型的头部。告诉客户端如何解析响应体内容。", example: "示例:Content-Type: application/json 表示 JSON 格式,Content-Type: text/html 表示 HTML。" }, { name: "Accept", pronunciation: "", category: "http", definition: "客户端告知服务器能处理的内容类型。服务器根据 Accept 头选择合适的内容类型返回。", example: "示例:Accept: application/json, text/html;q=0.9 优先接受 JSON。" } ]; let currentCategory = 'all'; function renderTerms(filteredTerms) { const grid = document.getElementById('glossaryGrid'); const noResults = document.getElementById('noResults'); if (filteredTerms.length === 0) { grid.innerHTML = ''; noResults.style.display = 'block'; return; } noResults.style.display = 'none'; grid.innerHTML = filteredTerms.map(term => `
${term.name} ${getCategoryName(term.category)}
${term.pronunciation ? `
${term.pronunciation}
` : ''}
${term.definition}
${term.example}
`).join(''); } function getCategoryName(category) { const names = { 'tcp-ip': 'TCP/IP', 'http': 'HTTP/HTTPS', 'dns': 'DNS', 'websocket': 'WebSocket', 'security': '安全', 'application': '应用层' }; return names[category] || category; } function searchTerms() { const query = document.getElementById('searchInput').value.toLowerCase(); const filtered = terms.filter(term => { const matchesSearch = term.name.toLowerCase().includes(query) || term.definition.toLowerCase().includes(query); const matchesCategory = currentCategory === 'all' || term.category === currentCategory; return matchesSearch && matchesCategory; }); renderTerms(filtered); } function filterByCategory(category) { currentCategory = category; document.querySelectorAll('.filter-btn').forEach(btn => { btn.classList.toggle('active', btn.dataset.category === category); }); searchTerms(); } function toggleTheme() { const current = document.documentElement.getAttribute('data-theme'); document.documentElement.setAttribute('data-theme', current === 'dark' ? 'light' : 'dark'); } // Initialize document.querySelectorAll('.filter-btn').forEach(btn => { btn.addEventListener('click', () => filterByCategory(btn.dataset.category)); }); renderTerms(terms);