Developing a protocol handler

Mozilla offers mechanisms by which a developer can build a protocol handler i.e. when the user types in “http://…” in the address field, or when the browser makes calls to retrieve elements specified on a web page, the code that handles that request is customised by the developer

I want to have my own protocol. is it possible? if so, is there documentation out there (or better yet, a working example) for how to do it?

thanks

p.s. something along these lines is what I have in mind: http://www.nexgenmedia.net/docs/protocol/