how to make TCP connection to an external server from GAE java

169 views
Skip to first unread message

jie lin

unread,
Oct 16, 2020, 9:46:33 AM10/16/20
to Google App Engine

Does the current GAE flex environment support TCP connection to an external server like SMTP , LDAP server ?

If it is not available in GAE flex env.,  what are the other options(choices) ?


thank u

Jerry


George (Cloud Platform Support)

unread,
Oct 19, 2020, 10:31:40 AM10/19/20
to Google App Engine
What do you mean by TCP connections, exactly, how does your use-case look like? 

WebSockets are supported now by App Engine Flex, you may check the "Introducing WebSockets support for App Engine Flexible Environment" page

Relevant examples are to be found on the Internet, for instance in a reply to the "How do I deploy socket.io to Google App Engine?" question in stackoverflow. Basically, you need to edit your app.yaml configuration file and set: 

network:
  session_affinity: true

jie lin

unread,
Oct 27, 2020, 9:53:05 AM10/27/20
to Google App Engine
I am planning to deploy an app on GCP platform.  The application communicates with LDAP server on port 636. Not sure which option is better one, like computer engine, gkt, etc.
could u please advise ?

thank you

Jerry

George (Cloud Platform Support)

unread,
Oct 27, 2020, 12:49:51 PM10/27/20
to Google App Engine
It depends on your use-case, which one is to be chosen. Seen that you need to maintain communication with the LDAP server, I'd say Compute Engine, but App Engine Flex is expected to work as well. You may find various comparisons on the Web, to help you decide. 

jie lin

unread,
Oct 28, 2020, 9:11:10 AM10/28/20
to Google App Engine
thank you for your help

Could u please answer one more question? Does Flex/GKE/Compute Engine allow egress message to go through the port lower than 1000 from GCP env. to LDAP server? 

thank you

Jerry

Olu

unread,
Oct 29, 2020, 11:15:47 AM10/29/20
to Google App Engine
Hello, Jerry

I believe a similar inquiry was raised and addressed on this issue tracker link[1] and as per the comment, the default network of Compute Engine allows all Egress traffic. 

Olu

unread,
Oct 29, 2020, 11:22:17 AM10/29/20
to Google App Engine
Hence, if you would want a particular behavior for your egress traffic, you may have to configure that using the App Engine Firewall rules[1] or using VPC firewall rules[2], setting up your own VPC[3] or probably using a shared VPC[4]

Reply all
Reply to author
Forward
0 new messages