As bibliotecas que aceitam net.Conn precisam funcionar sem modificação.
Limitações e restrições
A compatibilidade de soquetes com o App Engine tem as seguintes limitações:
Não é possível criar um soquete de escuta. Você só pode criar soquetes de saída.
O FTP não é compatível.
Só é possível usar TCP ou UDP. Não são permitidos protocolos arbitrários.
Não é possível se vincular a portas ou endereços IP específicos.
A porta 25 (SMTP) está bloqueada. Ainda é possível usar SMTP autenticado na
porta de envio 587.
Os intervalos de IP particulares, de transmissão, multicast e do Google são bloqueados, exceto
os listados abaixo:
DNS público do Google: 8.8.8.8, 8.8.4.4, 2001:4860:4860::8888,
2001:4860:4860::8844 porta 53
SMTPS do Gmail: smtp.gmail.com portas 465 e 587
POP3S do Gmail: pop.gmail.com porta 995
IMAPS do Gmail: imap.gmail.com porta 993
Os descritores de soquete estão associados ao app do App Engine que os criou e não são transferíveis, ou seja, não podem ser usados por outros aplicativos.
Os soquetes poderão ser recuperados depois de dez minutos de inatividade. Qualquer operação de soquete
mantém o soquete ativo por mais dez minutos.
Como usar soquetes com o servidor de desenvolvimento
É possível executar e testar código usando soquetes no servidor de desenvolvimento, sem empregar parâmetros de linha de comando especiais.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 UTC."],[[["\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."]]