There is a whole slew of measurement plugins available for Leaflet. Leaflet-MeasureControl and leaflet_measure both appear to have potential for your use-case. Alternatively, it would be very simple to implement your own point to point measurement using trigonometry. If the distances are short (10s of km), then you would not need the Haversine formula (though that too is an option for greater accuracy - do a search on this site for more info).
I also notice that you are using Postgresql and Geoserver. Yet another option is for you send the coordinates back to either Postgresql (through your web-server backend) or, even easier still, to Geoserver as a REST request and write a simple SQL query that will return the distance using ST_Distance. This would be a lot simpler than trying to implement the Haversine formula (so long as you remember to cast your coordinates as Geography types). Geoserver would then return the distance as JSON.