It's taken on the sense of going house to house, but originally it was from town to town, or in the literal Latin from market to market: the roots being circum-, around, about + forum, market square + verbal ending. I don't know when it was borrowed, but at least before the early 18th century -- at a guess, mid-17th, as it's the sort of wit I associate with the period.
A circumforaneous violinist went from table to table, playing for the diners until they paid him enough to go away.
---L.