Ruby and Unix Domain Sockets

C

Chris Roos

Hi,

This question has been brought to light after using Instiki on a FreeBsd
instance that is hosted within a FreeBsd Jail. I was trying to use the
--binding flag with Instiki to ensure that I was only listening to
requests from localhost (and then provide password protected access via
Apache and mod_proxy). Unfortunately this didn't work as I didn't have
access to the loopback interface.

The workaround at present is to set-up some firewall rules to block
incoming requests on the Instiki ports.

However, I spoke to my FreeBsd host and he suggested that if Instiki
could use Unix Domain Sockets rather than IP sockets then we could get
round this problem.

I asked on the Instiki Mailing List and Alexey has pointed me here.

I just wonder if anyone has any insight / thoughts about this problem?

Thanks in advance,

Chris
 
S

Sam Roberts

Hi,

This question has been brought to light after using Instiki on a FreeBsd
instance that is hosted within a FreeBsd Jail. I was trying to use the
--binding flag with Instiki to ensure that I was only listening to
requests from localhost (and then provide password protected access via
Apache and mod_proxy). Unfortunately this didn't work as I didn't have
access to the loopback interface.

I have no idea what --binding does in Instiki, however, you can use
Socket#bind() to bind a socket to 127.0.0.1 before listening on it so
that you can only receive connections from localhost. You won't be able
to call the convenience functions like TCPServer.new, but it should
work, unless I'm really forgetting my tcp.

Or maybe I don't follow you, are you saying this doesn't work?
However, I spoke to my FreeBsd host and he suggested that if Instiki
could use Unix Domain Sockets rather than IP sockets then we could get
round this problem.

I guess that would work, too, and they are supported by Socket.

Whats the problem with using them?

Cheers,
Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top