Having looked now at the electrum-server code (server.py) I see that the problem is the config "host" variable is used both for publishing the host address and also for binding the server listen processes.
Yes, that's my problem. I'm running the same node over standard network and over Tor network, but Electrum server don't give me a chance to propagate alternative URLs. Maybe that won't be so hard to add, simply add new config directive and publish these URLs in IRC details?
I was thinking more about this later and thought perhaps a good solution would be to make the hosts config item a list. Then the first one could be used for binding and any additional URLs could be passed thru as aliases to IRC.
eg.
"hosts": [ "california.stratum.bitcoincz:50001", "4lhnnupincd3gyda.onion:50001" ]
This would be fairly minor code changes as far as I can see. It could auto-detect string or list to be compatible with any existing install. In order for me to test changes I think I would have to install and run Bitcoin-Abe again as I wiped it some months ago. I can do that but it will take quite some time to fill the database.
I prefer to publish more URLs for one IRC nick, just to make clear that all URLs are pointing to the same node. This solution will be also cleaner for backward compatibility. I'm not sure how will old (=existing) Electrum clients handle URLs poining to ".onion" domain. But they'll surely ignore additional information in IRC details...
From my brief reading of the code it seems the client just adds whatever URL is given to the list. But if a list of URLs was used the code would have to be updated to detect it and iterate.
(Is the onion name operable right now? I tried using it a few times and it never seems to work, for me anyway. But connecting to regular servers via Tor works fine.)
It works for me now. You can try "torify telnet 4lhnnupincd3gyda.onion 50001"...
Will try this again.
Edit: I forked electrum-server and was going to work on changes but see now that it'll take a lot more effort to get it up and running and I'll have to do it on one of my other servers, not my laptop. I'll have to rebuild bitcoind with a patch and have a mysql db available. So this will be delayed. I'm willing to make code changes now that someone else (slush?) can test to see if we can get support for publishing the onion name.
Also, see now that the format for config isn't correct. Not the same as electrum client. So it would actually need to be more like,
hosts = california.stratum.bitcoincz:50001, 4lhnnupincd3gyda.onion:50001
but should still be workable.