Skip to content

Instantly share code, notes, and snippets.

@thefinnomenon
Created January 25, 2017 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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

why 443?

@sagark1510
Copy link

@thefinnomenon how can I do the same with android?

@thefinnomenon
Copy link
Author

thefinnomenon commented Aug 11, 2021

@thefinnomenon
Copy link
Author

thefinnomenon commented Aug 11, 2021

@thefinnomenon how can I do the same with android?

@sagark1510
Not really sure on the Android side but I would just grep for a similar debugger-proxy string and edit it the same as I did here.

@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