Currently you need to use this to connect to a headless server at 123.123.123.123 which is not running on the standard port but on port 12345:
megaglest --connecthost=123.123.123.123 --use-ports=12345,61357
This works, but is a bit of a crude syntax. It would be nice if IP address and port # could be sepcified in a single parameter, separated by a colon, like this:
megaglest --connect 123.123.123.123:12345
(syntax partially stolen from OpenSSL)
Edit (tomreyn):
With no colon and port # provided, assume default port (61357).