It doesn’t matter what you put into the settings for your app. Put in the URL of your website, for example. Just pass along your localhost callback in the actual API call to authorize. I actually write my code in a way that it looks at the current URL to generate a callback URL, so the code works unchanged whether testing on my PC or on the server in the cloud.
As an example, if you are using Java Servlets (which you are probably not, but…), you can use code like this:
TwitterFactory twitterFactory;
twitterFactory = new TwitterFactory();
Twitter twitter = twitterFactory.getInstance();
twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
StringBuffer callbackURL = request.getRequestURL();
int index = callbackURL.lastIndexOf("/");
callbackURL.replace(index, callbackURL.length(), "").append("/callback");
try
{
RequestToken twitterRequestToken = twitter.getOAuthRequestToken(callbackURL.toString());
request.getSession().setAttribute("requestToken", twitterRequestToken);
String authorizationUrl = twitterRequestToken.getAuthorizationURL();
response.sendRedirect(twitterRequestToken.getAuthenticationURL());
}
catch (TwitterException e)
{
throw new ServletException(e);
}