# $binary\_remote\_addr byte order (big-endian guaranteed?)

**URL:** <https://www.ruby-forum.com/t/binary-remote-addr-byte-order-big-endian-guaranteed/198679>\
**Category:** NGINX\
**Created:** [November 5, 2010, 9:08am UTC](https://www.ruby-forum.com/t/binary-remote-addr-byte-order-big-endian-guaranteed/198679 "2010-11-05T09:08:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 5, 2010, 9:08am UTC](https://www.ruby-forum.com/t/binary-remote-addr-byte-order-big-endian-guaranteed/198679/1 "2010-11-05T09:08:05Z")

</div>

In what format is $binary\_remote\_addr? Test shows network byte order  
(big-endian), but is that guaranteed?

English wiki doesn’t say, and my Russian leaves much to be desired.

helen

Posted at Nginx Forum:

> **[$binary\_remote\_addr byte order (big-endian guaranteed?)](https://forum.nginx.org/read.php?2,147895,147895#msg-147895)**
>
> In what format is $binary\_remote\_addr? Test shows network byte order (big-endian), but is that guaranteed? English wiki doesn't say, and my Russian leaves much to be desired. helen

---

<div class="post-metadata">

**Author:** ![helen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a88e57/32.png) [@helen](https://www.ruby-forum.com/u/helen)\
**Post date:** [November 5, 2010, 1:13pm UTC](https://www.ruby-forum.com/t/binary-remote-addr-byte-order-big-endian-guaranteed/198679/2 "2010-11-05T13:13:03Z")

</div>

Hello!

On Fri, Nov 05, 2010 at 04:06:44AM -0400, helen wrote:

> In what format is $binary\_remote\_addr? Test shows network byte order  
> (big-endian), but is that guaranteed?

It’s remote address as returned by accept(), either s\_addr for  
ipv4 or s6\_addr for ipv6. Both are guaranteed to be in network  
byte order[1]. Value for unix socket connections is unspecified.

[1]  
[http://www.opengroup.org/onlinepubs/9699919799/basedefs/netinet\_in.h.html](http://www.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html)

> English wiki doesn’t say, and my Russian leaves much to be desired.

Use the Source, Luke! 😉

Maxim D.
