@didek @freemo @kaip @ademalsasa activitypub works over http and there's nothing you can do about that. the client doesn't have to be hosted on the same domain though, and neither does the c2s api.
the only domains that matter for federation are the webfinger domain (the part of your handle after the second @) and the domain that serves actors and activities. they can be different, but neither can change.
the webfinger domain has to respond to .well-known/webfinger, can host whatever it wants at other paths. so having domain.tld in your handle, but running mastodon on social.domain.tld is possible. that feature is rarely used though.
the activitypub domain will be used to serve actors and activities. their URIs act as globally unique IDs, so they can't change. technically, the server can choose whatever paths for them, e. g. could host a whole instance on one page using url query parameters, and a different website on other pages. in practice, no existing activitypub software supports that, so you'll have to give it the whole domain.
If you want anything that can behave like a mx record we have txt records for that.. use it however you want and rewrite mastodon.. its all good :) but thats not how its built now.
@freemo @didek @kaip @ademalsasa i mean, rewriting mastodon wouldn't do anyone any good, since it would be incompatible with the existing network
webfinger does behave sorta like an mx record, though. the only difference is that it works over http and can't be changed.