MyHook is a Tool which helps you exposing your local services for your clients, teammates and other development tools. Using MyHook you won't need to buy a public domain or server for testing or presentation purposes. MyHook will reserve a subdomain for you which will be publicly accessible from every device connected on the Internet. In a simple workspace, you will be able to monitor every request which comes from your public - to your local hook including all request and response details.
Currently running on: https://myhook.io
- OS :P
- Chrome or Firefox
- NodeJS 8 or 11 / both work
chrome-extension
- this contains the source code for the Chrome Extension.
firefox-addon
- this contains the source code for Firefox Add On. The code here is 95.6%+ similar with the
Chrome Extension.
myhook-electron
- this contains the source code of Electron. The most of the source code here is the same as in
the browser extensions. There is a custom mechanism built that allowed to use the same implementation as in the browser
extensions.
myhook-tester
- this is a simple JS Script that tries to test the limits of MyHook.
node-server
- here is the place where a part of magic happen. This contains the source code of the server where all the
communication between the local services and public sub domain happens.
In order to run MyHook to your local machine or deploy it to your public server you have to follow the steps below:
- Translate a domain (not real one) to your local IP address. (this step can be skipped in case you use a public domain as you have to handle this to your DNS)
- Translate a sub domain to your local IP address. (this step can be skipped in case you use a public domain as you have to handle this to your DNS)
- Run the node server which handles all the communication between MyHook and Clients.
- Load one of the extensions (Chrome or Firefox) you want to use.
- Run the electron app if you want to experience the Desktop version and have more access to rewrite HTTP headers on your local service.
MyHook needs a domain in order to work properly. In your local environment you can translate a dummy domain to your
local IP. Add the line below in your hosts
file:
127.0.0.1 yourdummydomain.com
Every client on MyHook will have their own sub domain which will be their public address for their local service. MyHook generates
random string as subdomains. In order to make your local DNS system to recognize subdomains of yourdummydomain.com
you have to use
existing tools like dnsmasq
or any other tool.
Another simple way to do this is by translating an specific sub domain to your local IP Address. You have to set useTestSubdomain
(explained below)
to true
and then add the line below to your hosts:
127.0.0.1 test.yourdummydomain.com
- Change the directory to
node-server
:cd node-server
- Change your main domain, port, SSL(optional) in
package.json -> config
mainDomain
- the public domain you're using. Example: myhook.io. This domain will be used when serving the sub domain.
httpPort
- in case theuseSSL
is false then this port will be used for your service.
useTestSubdomain
- determines if the sub domain for the client would betest.yourdomain.com
or a random string. This should be true only if you run MyHook in your local machine as in the public domain the sub domains should be unique.
useSSL
- determines if you're going to use SSL or not.
sslCerts.key
- the ssl key
sslCerts.cert
- the ssl certificate
sslCerts.ca
- the CA bundle - Install npm dependencies:
npm i
- Start the server:
npm run start
ornode app.js
You can use the browser (Chrome or Firefox) extension to test your MyHook Setup. In order yo use the extensions you have to change a parameter to the extension (Chrome or Firefox).
- In the file
{extension_path}/js/logic.js
and{extension_path}/js/main.js
change the domainhttps://myhook.io
to this:'{your_protocol}://{yourdummydomain.com}';
- Go to:
chrome://extensions/
orabout:debugging
page for Firefox - For Chrome: Click Load unpacked and select the folder of your extension. For Firefox: Click "Load Temporary Add-on", then select any file in your extension's directory.
5. Run the electron app if you want to experience the Desktop version and have more access to rewrite HTTP headers on your local service.
- Change the directory to
myhook-electron
:cd myhook-electron
- In the file
index.js
,app/js/main.js
andapp/js/logic.js
change the domainhttps://myhook.io
to this:'{your_protocol}://{yourdummydomain.com}';
- Install dependencies:
npm i
- Run electron app:
npm run start
In case you want to start an client instance of MyHook from another software then you can do this by using the electron client app of MyHook and following the steps below:
- Create a JSON file to your OS temp directory with the filename
myhook-connection-dt.json
. Example: Windows:%temp%\myhook-connection-dt.json
- The JSON should look like the structure below:
{
"host" : "localost" # the address of your local service,
"port" : 43434 # the port where your local service is running
}
At the end start a new process of MyHook Desktop client.