Sockets API for legacy bundled services
Stay organized with collections
Save and categorize content based on your preferences.
Traffic from sockets is billed as
outgoing bandwidth.
App Engine supports outbound sockets through the
appengine/socket
package.
Libraries that can accept a net.Conn
should work without modification.
Limitations and restrictions
Socket support in App Engine has the following limitations:
- You cannot create a listen socket; you can only create outbound sockets.
- FTP is not supported.
- You can only use TCP or UDP; arbitrary protocols are not allowed.
- You cannot bind to specific IP addresses or ports.
- Port 25 (SMTP) is blocked; you can still use authenticated SMTP on the
submission port 587.
Private, broadcast, multicast, and Google IP ranges are blocked, except
those listed below:
- Google Public DNS:
8.8.8.8
, 8.8.4.4
, 2001:4860:4860::8888
,
2001:4860:4860::8844
port 53
- Gmail SMTPS:
smtp.gmail.com
port 465 and 587
- Gmail POP3S:
pop.gmail.com
port 995
- Gmail IMAPS:
imap.gmail.com
port 993
Socket descriptors are associated with the App Engine app that
created them and are non-transferable (cannot be used by other apps).
Sockets may be reclaimed after 10 minutes of inactivity; any socket operation
keeps the socket alive for a further 10 minutes.
Using sockets with the development server
You can run and test code using sockets on the development server, without using
any special command line parameters.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-01 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-10-01 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-01 UTC."]]