Improved local IP detection (for debug mode)