title: AWS Xray-Daemon locally, unable to connect Xray using Xray-daemon from my app
body: <p>I'm running Xray daemon locally, and I wanted to push the data to Xray from my docker app by setting up daemon <code>AWSXRay.setDaemonAddress('127.0.0.1:2000')</code>.</p>
  
  <p>Verified the daemon installation by running <code>cat segment.txt &gt; /dev/udp/127.0.0.1/2000</code> inside the daemon container and its working well, how to run this outside of the container?</p>
  
  <pre><code>2020-05-11T04:39:45Z [Debug] processor: sending partial batch
  2020-05-11T04:39:45Z [Debug] processor: segment batch size: 1. capacity: 50
  2020-05-11T04:39:46Z [Info] Successfully sent batch of 1 segments (1.653 seconds)
  2020-05-11T04:40:19Z [Debug] Send 1 telemetry record(s)
  </code></pre>
  
  <p>Created a new network as Mynetwork and connected both the containers (app and daemon) to that. Even able to ping them</p>
  
  <pre><code>docker exec -ti Myapp ping daemon
  </code></pre>
  
  <p>Tried passing IP address, docker ipv4 address (172.21.0.2), and name of the container as <em>xray-daemon</em> for host in AWSXRay.setDaemonAddress('host:2000') but nothing is happening neither an error nor any success in the daemon logs.</p>
  
  <p>Can see the configured message in the app logs but it seems like the linking is not happening</p>
  
  <pre><code>2020-05-11 11:19:49.895 +00:00 [INFO] Configured daemon address to 127.0.0.1:2000
  </code></pre>
  
  <p>Any suggestions to access daemon in my app?</p>
  
  <p>Here are my application logs, my app is a dockerized node application.</p>
  
  <pre><code>2020-05-12 02:48:33.359 +00:00 [DEBUG] Starting the AWS X-Ray SDK in automatic mode (default).
  2020-05-12 02:48:33.364 +00:00 [DEBUG] AWS_XRAY_CONTEXT_MISSING is set. Configured context missing strategy to LOG_ERROR.
  2020-05-12 02:48:33.389 +00:00 [INFO] Using custom sampling rules file: src/utils/awsXrayRule.json
  2020-05-12 02:48:33.394 +00:00 [INFO] Configured daemon address to 127.0.0.1:2000.
  app listening on port 3000!
  2020-05-12 02:49:29.342 +00:00 [DEBUG] Starting segment: MY_NODE_APP
  2020-05-12 02:49:29.352 +00:00 [DEBUG] Segment sent: {"trace_id:"1-5eba0eb9-8fda8d30ca36e717ae849f68","id":"a96cdf725443768e"}
  2020-05-12 02:49:29.352 +00:00 [DEBUG] UDP message sent: {"trace_id":"1-5eba0eb9-8fda8d30ca36e717ae849f68","id":"a96cdf725443768e","start_time":1589251769.342,"name":"MY_NODE_APP","service":{"runtime":"node","runtime_version":"v13.10.1","version":"1.0.0","name":"my-node-app"},"aws":{"xray":{"sdk":"X-Ray for Node.js","sdk_version":"3.0.0","package":"aws-xray-sdk"}},"annotations":{"key1":"value2"},"end_time":1589251769.346}
  </code></pre>
  
  <p>samplingrules.json:</p>
  
  <pre><code>{
     "version": 1,
     "default": {
       "fixed_target": 1,
       "rate": 1.0
     }
   }
  </code></pre>