Closed imyuanx closed 1 year ago
I don't think you can pack the binary into the package, as different ngrok binaries run on different operating systems. If you are building and testing your electron based application on one operating system, you will find that it works, but if you were to try your application on a different operating system you'd probably find that the packaged ngrok binary would fail.
That's why this package downloads the correct ngrok binary for the system it is installed on as its first job.
Since you are packaging the application, you may need to call upon the download
function as described here to fetch the correct binary for the system the application is running on.
It is difficult to package applications for other operating systems, so we need to package applications for the current system on each operating system.
Downloading the ngrok binary file after the build will have some requirements for the network, But this can reduce the volume of the application.
This may require some trade-offs.
I understand that's not ideal. The good news is that ngrok themselves are starting to build out the agent functionality as libraries. They have a go-lang version and a rust version so far. So in the future you should be able to require the JavaScript version of the ngrok agent to handle this. It's worth looking out for in the future.
OK, So far, this package is the best solution, Thank for you great job!
Hey, I have a electron app, I got an error after building. It is normal in development mode.
ngrok binary file is packed into asar archive, so call ngrok must use execFile. (Description in electron)
I solved the problem by hack:
Maybe we can provide an option for electron?