[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-20。"],[[["\u003cp\u003eThis socket API is outdated and only compatible with the Go 1.11 runtime, requiring migration to a recommended solution before upgrading to Go 1.12 or later.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine supports outbound socket connections through the \u003ccode\u003eappengine/socket\u003c/code\u003e package, with traffic billed as outgoing bandwidth.\u003c/p\u003e\n"],["\u003cp\u003eSocket functionality in App Engine is limited to outbound connections, prohibiting the creation of listening sockets and supporting only TCP or UDP protocols.\u003c/p\u003e\n"],["\u003cp\u003eCertain ports and IP ranges are restricted, including port 25 (SMTP) and private, broadcast, or multicast IP ranges, with exceptions for specific Google services like DNS and Gmail.\u003c/p\u003e\n"],["\u003cp\u003eSockets are tied to the App Engine app that creates them and can be automatically reclaimed after 10 minutes of inactivity.\u003c/p\u003e\n"]]],[],null,["# Sockets API for legacy bundled services\n\n| **Caution:** **This solution is no longer recommended:** Apps that use this API can only run in the Go 1.11 runtime and will need to upgrade to a [recommended solution](/appengine/migration-center/standard/services/migrating-services) before migrating to the Go 1.12+ runtime.\n\nTraffic from sockets is billed as [outgoing bandwidth](/appengine/docs/pricing#Billable_Resource_Unit_Costs). App Engine supports outbound sockets through the [`appengine/socket` package](/appengine/docs/legacy/standard/go111/reference/latest/socket).\n\n\u003cbr /\u003e\n\nLibraries that can accept a `net.Conn` should work without modification.\n\n\nLimitations and restrictions\n----------------------------\n\nSocket support in App Engine has the following limitations:\n\n- You cannot create a listen socket; you can only create outbound sockets.\n- FTP is not supported.\n- You can only use TCP or UDP; arbitrary protocols are not allowed.\n- You cannot bind to specific IP addresses or ports.\n- Port 25 (SMTP) is blocked; you can still use authenticated SMTP on the submission port 587.\n- Private, broadcast, multicast, and Google IP ranges are blocked, except\n those listed below:\n\n - Google Public DNS: `8.8.8.8`, `8.8.4.4`, `2001:4860:4860::8888`, `2001:4860:4860::8844` port 53\n - Gmail SMTPS: `smtp.gmail.com` port 465 and 587\n - Gmail POP3S: `pop.gmail.com` port 995\n - Gmail IMAPS: `imap.gmail.com` port 993\n\n | **Note:** Google Compute Engine IP addresses are not considered to be in Google IP ranges. You can use sockets to connect App Engine apps to Compute Engine instances.\n- Socket descriptors are associated with the App Engine app that\n created them and are non-transferable (cannot be used by other apps).\n\n- Sockets may be reclaimed after 10 minutes of inactivity; any socket operation\n keeps the socket alive for a further 10 minutes.\n\n\n Using sockets with the development server\n -----------------------------------------\n\n You can run and test code using sockets on the development server, without using\n any special command line parameters."]]