I have ported my code over to BeEF #beefproject http://beefproject.com/ My module is not in the repository yet.
1. Meanwhile, you can download the file attached and copy and extract the files to /pentest/web/beef/modules/host/ . After that, you should be able to access the module in BeEF as shown in the below screenshot.
2. The user will receive the below popup in their web browser. You can change the name of the Java applet to something more discrete as compared to what I have named.
Within seconds, you should be able to get the geolocation of the remote user.
You can download the BeEF module via one of the below links if you do not want to wait for it to be committed to the repository.
I will be doing a write up about the things I learn about writing BeEF module with Java applet integration in the next couple of days.
I hope it can help other people who are just getting started with BeEF development.
Let me know if you would have any suggestions. Thanks !