How to configure 2 different url for single custom datasource

I am trying to create a custom datasource and wanted to configure two different rest end points with two urls in datasource configurations.
Based on type selection on query panel, request should go to respective end point.
My url are of type server proxy and browser not able to understand.
What extra parameter need to pass to success.
Any help would be great.