Search code examples
linuxamazon-web-servicesnetwork-programmingaws-xray

Change 127.0.0.1 to 0.0.0.0 for a AWS Service


Installed AWS x-ray on a ec2 instance. Its listening on 127.0.0.1:port number. I want to make it listen to the open traffic(0.0.0.0) Can we do that?


Solution

  • You can change the cfg.yaml file (which should be alongside with the daemon) to add:

    Socket: UDPAddress: "0.0.0.0:3000" TCPAddress: "0.0.0.0:3000"

    or use command line option -b "0.0.0.0:3000" -t "0.0.0.0:3000" when start the daemon. Please note the TCP address is only valid on X-Ray daemon 3.x. You can see how to configure the daemon at https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon-configuration.html.

    You usually need to make it listen to public when you run your application and X-Ray daemon in multi-docker containers and what is your use case on an EC2 instance?