diff --git a/re-natal.coffee b/re-natal.coffee index edb5f07..c442008 100644 --- a/re-natal.coffee +++ b/re-natal.coffee @@ -28,7 +28,7 @@ platformRx = /\$PLATFORM\$/g devHostRx = /\$DEV_HOST\$/g ipAddressRx = /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/i figwheelUrlRx = /ws:\/\/[0-9a-zA-Z\.]*:/g -appDelegateRx = /http:\/\/[^:]+/g +serverRx = /http:\/\/[^:]+/g rnVersion = '0.23.1' rnPackagerPort = 8081 process.title = 're-natal' @@ -462,7 +462,11 @@ updateFigwheelUrls = (devEnvRoot, androidHost, iosHost) -> updateIosAppDelegate = (projName, iosHost) -> appDelegatePath = "ios/#{projName}/AppDelegate.m" - edit appDelegatePath, [[appDelegateRx, "http://#{iosHost}"]] + edit appDelegatePath, [[serverRx, "http://#{iosHost}"]] + +updateIosRCTWebSocketExecutor = (iosHost) -> + RCTWebSocketExecutorPath = "node_modules/react-native/Libraries/WebSocket/RCTWebSocketExecutor.m" + edit RCTWebSocketExecutorPath, [[serverRx, "http://#{iosHost}"]] generateDevScripts = () -> try @@ -491,6 +495,9 @@ generateDevScripts = () -> updateIosAppDelegate(projName, iosDevHost) log "AppDelegate.m was updated" + + updateIosRCTWebSocketExecutor(iosDevHost) + log "RCTWebSocketExecutor.m was updated" updateFigwheelUrls(devEnvRoot, androidDevHost, iosDevHost) log 'Dev server host for iOS: ' + iosDevHost