# How to get a destination IP from a UDP packet?

**URL:** <https://www.ruby-forum.com/t/how-to-get-a-destination-ip-from-a-udp-packet/159447>\
**Category:** Ruby\
**Created:** [February 4, 2009, 5:45pm UTC](https://www.ruby-forum.com/t/how-to-get-a-destination-ip-from-a-udp-packet/159447 "2009-02-04T17:45:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gavinyap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f08c70/32.png) [@gavinyap](https://www.ruby-forum.com/u/gavinyap)\
**Post date:** [February 4, 2009, 5:45pm UTC](https://www.ruby-forum.com/t/how-to-get-a-destination-ip-from-a-udp-packet/159447/1 "2009-02-04T17:45:14Z")

</div>

Hi there,

I wanna to get the destination ip of a UDP packet, when it arrives at  
the server.  
I need this so that the server could inspect the packet whether it is a  
broadcast or unicast(to the server) packet and do different things with  
is
