Skip to content

Instantly share code, notes, and snippets.

@thefinnomenon
Created January 25, 2017 17:44
Show Gist options
  • Save thefinnomenon/de4afd8da2052be15708345d72641c16 to your computer and use it in GitHub Desktop.
Save thefinnomenon/de4afd8da2052be15708345d72641c16 to your computer and use it in GitHub Desktop.
React Native iOS Remote Debugger using ngrok
...
- (void)setUp
{
if (!_url) {
NSUserDefaults *standardDefaults = [NSUserDefaults standardUserDefaults];
NSInteger port = [standardDefaults integerForKey:@"websocket-executor-port"];
if (!port) {
port = [[[_bridge bundleURL] port] integerValue] ?: 8081;
}
NSString *host = [[_bridge bundleURL] host];
if (!host) {
host = @"localhost";
}
//NSString *URLString = [NSString stringWithFormat:@"http://%@:%zd/debugger-proxy?role=client", host, port];
NSString *URLString = [NSString stringWithFormat:@"https://%s:%zd/debugger-proxy?role=client", "<YOUR SUBDOMAIN>.ngrok.io", 443];
_url = [RCTConvert NSURL:URLString];
}
...
@samermurad
Copy link

@thefinnomenon Yeah I know about http/s default ports, I think what me in 2017 meant was, why hardcoded, but this makes no sense either, so no idea what I wanted

@thefinnomenon
Copy link
Author

@samermurad haha fair enough. I can't even remember writing this tbh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment