Yes, .listen(0) followed by .address().port is what I meant by " use an
ephemeral port" :-)

~Ryan

On Tue, 30 Jun 2015 at 18:05 Greg Reimer <[email protected]> wrote:

> That seems reasonable. I see nothing about working with "ephemeral ports"
> in the node/iojs docs, but suspect server.listen(0) (which listens on a
> "random" port) and then then connecting to whatever's in server.address()
> would be the way to do that. Assuming there isn't a better way I'll give
> that a try.
>
> Thanks!
>
> On Tuesday, June 30, 2015 at 12:29:59 PM UTC-6, Ryan Graham wrote:
>
>> If you only plan on using it from within the process, you could use an
>> ephemeral port binding, which shouldn't "tie up" a useful TCP port.
>>
>> ~Ryan
>>
>> On Tue, 30 Jun 2015 at 09:02 Greg Reimer <[email protected]> wrote:
>>
> Basically, it would be nice to be able to create a server object that I
>>> could have in memory and connect to directly (for proxying purposes)
>>> *without* tying up a socket file or a TCP port.
>>>
>>> I've been looking for a way to do this for a while actually, and it
>>> seems like it should be possible in principle, but have had no luck finding
>>> an example. Maybe it simply isn't possible?
>>>
>>> Thanks,
>>> Greg
>>>
>>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAGjmZGzp6Eh1saQ9WHJOmpHwfAQTRrfUs-%3DekWe0_BSuQanciQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to