Hello Everybody,

I have another question about output harbor. It it possible to add our own
page in stead of "This page isn't available."

Thanks

-----Message d'origine-----
De : Romain Beauxis [mailto:[email protected]] 
Envoyé : mercredi 10 août 2011 07:18
À : Guillaume (Numerizik)
Cc : [email protected]
Objet : Re: [Savonet-users] Output.harbor

2011/8/9 Guillaume (Numerizik) <[email protected]>:
> Yes ! i'll do this !
>
> Can you give me sample for auth, on_connect and on_disconnect ? I 
> don't really understand good syntax.

This works:

max_listeners = 2
listeners = ref 0

def auth(_,_) =
  if !listeners < max_listeners then
    listeners := !listeners + 1
    log("One more listener! Total count: #{!listeners}")
    true
  else
    log("Maximun number of listeners reached..")
    false
  end
end

def on_disconnect(_) =
  log("On less listener..")
  listeners := !listeners - 1
end

output.harbor(%mp3,
              mount="foo",
              auth=auth,
              on_disconnect=on_disconnect,
              sine())

However, while testing it I realized that this kind of use was not initally
intended...
First, you need to pass a fake authentication data:
  http://fake_user:fake_passord@host:8000/foo

Second, client that try to connect while maximun number of listeners is
reached will get a "wrong authentication" response, which may be confusing..

I will see what I can do about these two..

Also, dont forget to test before puttin in production: this is a relatively
new feature and quite a big chunk of code..

Romain


------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to