You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Holger Hoffstätte <ho...@googlemail.com> on 2011/01/17 21:05:05 UTC

Running HTTP service on random free port

Hi,

I'm looking at the HTTP Service and was wondering if anyone can tell if or
how I can let the implementation pick a free port for a service, instead
of having to choose one myself? The reachable address would be
communicated to the outside world by different means, but I don't want to
specify the port up front. From reading the docs it doesn't seem to be
possible.
Would have been nice for ad-hoc services and such.

thanks
Holger

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Running HTTP service on random free port

Posted by Carl Hall <ca...@hallwaytech.com>.
Just wanted to nudge this conversation. The patch has been out there for a
while and was wondering if there is anything I should do.


On Thu, Jan 20, 2011 at 2:59 PM, Holger Hoffstätte <
holger.hoffstaette@googlemail.com> wrote:

> On 20.01.2011 23:50, Carl Hall wrote:
> > This sounds pretty interesting.  I'll take a stab at this and be sure to
> > update the JIRA [1].
> >
> > [1] https://issues.apache.org/jira/browse/FELIX-2786
>
> Great! I would have gotten to it eventually but have other things on my
> list for now. Will gladly provide moral support & help test :)
>
> cheers
> -h
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Running HTTP service on random free port

Posted by Holger Hoffstätte <ho...@googlemail.com>.
On 20.01.2011 23:50, Carl Hall wrote:
> This sounds pretty interesting.  I'll take a stab at this and be sure to
> update the JIRA [1].
> 
> [1] https://issues.apache.org/jira/browse/FELIX-2786

Great! I would have gotten to it eventually but have other things on my
list for now. Will gladly provide moral support & help test :)

cheers
-h

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Running HTTP service on random free port

Posted by Carl Hall <ca...@hallwaytech.com>.
This sounds pretty interesting.  I'll take a stab at this and be sure to
update the JIRA [1].

1 https://issues.apache.org/jira/browse/FELIX-2786
 <https://issues.apache.org/jira/browse/FELIX-2786>

On Mon, Jan 17, 2011 at 4:11 PM, Marcel Offermans <
marcel.offermans@luminis.nl> wrote:

> On Jan 17, 2011, at 21:05 , Holger Hoffstätte wrote:
>
> > I'm looking at the HTTP Service and was wondering if anyone can tell if
> or
> > how I can let the implementation pick a free port for a service, instead
> > of having to choose one myself? The reachable address would be
> > communicated to the outside world by different means, but I don't want to
> > specify the port up front. From reading the docs it doesn't seem to be
> > possible.
> > Would have been nice for ad-hoc services and such.
>
> I'm pretty sure that's currently not possible.
>
> You could try configuring it (through Configuration Admin) with port N,
> then register some servlet and see if you can actually reach that servlet
> (repeating those steps until you can) but that's not the most elegant
> solution.
>
> The current configuration you can "see" by looking at the actual service
> properties, which are propagated from the configuration.
>
> I think it would be nice to have a setting "port=random" or
> "port="pick-from-range(8000,9000)" or something similar, so why not supply a
> patch!
>
> Greetings, Marcel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Running HTTP service on random free port

Posted by Marcel Offermans <ma...@luminis.nl>.
On Jan 17, 2011, at 21:05 , Holger Hoffstätte wrote:

> I'm looking at the HTTP Service and was wondering if anyone can tell if or
> how I can let the implementation pick a free port for a service, instead
> of having to choose one myself? The reachable address would be
> communicated to the outside world by different means, but I don't want to
> specify the port up front. From reading the docs it doesn't seem to be
> possible.
> Would have been nice for ad-hoc services and such.

I'm pretty sure that's currently not possible.

You could try configuring it (through Configuration Admin) with port N, then register some servlet and see if you can actually reach that servlet (repeating those steps until you can) but that's not the most elegant solution.

The current configuration you can "see" by looking at the actual service properties, which are propagated from the configuration.

I think it would be nice to have a setting "port=random" or "port="pick-from-range(8000,9000)" or something similar, so why not supply a patch!

Greetings, Marcel


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org