The Question and Answer section for The Mayor of Casterbridge is a great resource to ask questions, find answers, and discuss the novel.
Is this from the Mayor of Casterbridge?
I would say it was unethical, even within the context of those times. Michael Henchard, for example, offers to sell his wife and daughter to the highest bidder. Michael will regret this decision.
This quote alludes to the fact the speaker is willing to share personal information with a stranger almost immediately after they've met. Think about your own life..... do you find this odd or understandable. Personally, I find it unthinkable.