The listening port of a custom image must be the same as that of the HTTP server of the custom image. The default listening port (CAPort) of a custom image runtime is port 9000. If a custom image uses the default listening port, the listening port of its HTTP server must be port 9000. If the listening port of the custom image is port 8080, the listening port of its HTTP server must be port 8080.
The HTTP server that is started in a custom image must listen on the 0.0.0.0:CAPort or *:CAPort port. If you select the 127.0.0.1:CAPort port, a request times out and the following error occurs:
{
"ErrorCode":"FunctionNotStarted",
"ErrorMessage":"TheCA'shttpservercannotbestarted:ContainerStartDuration:25000000000.PingCAfaileddueto:dialtcp21.0.5.7:9000:getsockopt:connectionrefusedLogs:2019-11-29T09:53:30.859837462ZListeningonport9000"
}