Click here to show or hide the menubar.

Radio2's "natural" URL


I think maybe I've figured out what the problem was with using Radio2 via its natural URL, instead of having to assign a domain to it. That would eliminate the need to create a domain for Radio2 use on the server before getting anything done. It goes from being a requirement to being nice-to-have.

History (skip if you're not interested)

Inside the Frontier server there are the equivalent of callbacks called "responders" -- this is part of the original web framework designed back in 1996 by Wes Felter. It's part of the lizard brain of the CMS in our server.

There were generations of responders, first came the websiteFramework responder, which basically wired up our previous framework for generating static sites to the builtin HTTP server. It was a way of quickly getting something useful running so we could gain the experience to show us what was needed.

Which begat mainResponder, which was originally thought of as an app, before there were tools -- and which became so central to using the server that when I transitioned to OPML, I brought it into opml.root. There was no reason not to have mainResponder available on every system.

When you come into the server through mainResponder you get a lot of nice services automatically, including parsing multipart forms. The apps that run on mainResponder don't have to do anything. The params arrive inside a table called postArgs, whether they got there through a normal post operation or one that had a multipart form on the page. And here's the problem. The websiteFramework responder didn't have support for multipart forms. And Radio2 uses a mutlipart form because you can attach an enclosure to a post without going to another page. And the reason it worked one way, through the custom domain and not through the other, via the "natural" URL? Because the former went through mainresponder and the other went through websiteframework. Bing.

So I hacked in support into the main routine for Radio2 so that if there is no postargs table, it does the same thing mainresponder does. This means it continues to work as it did before when you come in through mainresponder, and if you come in through wsf.

BTW it was considered funny at the time that the shorthand name for Website Framework was WSF, which also happens to be Wes Felter's initials. And now you know the rest. of. the. story. :-)

Testing

You can help me out after installing this update on radio2.root, by using your Radio2 site through its natural URL and letting me know if anything doesn't work properly. There are likely to be some other services that mainresponder is providing that we need to account for.

Suppose your server is server.bloatware.org, your Radio2 site would be:

http://server.bloatware.org/radio2/

Parts

radio2suite.main


Posted on Friday, April 13, 2012 at 2:04 PM by Dave Winer.