Corporations formed under this article for the purpose of supplying water to any city, town or the inhabitants thereof for any purpose, may lay their mains or pipes in, along and upon any of the public streets or alleys of such city or town, subject to such regulations as may be provided by the corporate authorities of such city or town; and may furnish and supply such city or town or the inhabitants thereof, with water, upon such conditons [conditions] and terms as may be fixed by such corporations, or as may be agreed to by the consumers and such corporations.