You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -60,12 +61,53 @@ import devtools from '@vue/devtools'
60
61
And connect to host:
61
62
```js
62
63
if (process.env.NODE_ENV==='development') {
63
-
devtools.connect(/* host */)
64
+
devtools.connect(/* host, port*/)
64
65
}
65
66
```
66
67
67
68
**host** - is an optional argument that tells your application where devtools middleware server is running, if you debug you app on your computer you don't have to set this (the default is `http://localhost`), but if you want to debug your app on mobile devices, you might want to pass your local IP (e.g. `192.168.1.12`).
68
69
70
+
**port** - is an optional argument that tells your application on what port devtools middleware server is running. If you use proxy server, you might want to set it to `null` so the port won't be added to connection URL.
71
+
72
+
#### FAQ:
73
+
74
+
**1. How to change port devtools server is running on?**
75
+
76
+
You can change it by setting environment variable before running it:
77
+
```
78
+
PORT=8000 vue-devtools
79
+
```
80
+
81
+
Then in your app you'll have to set either:
82
+
```
83
+
window.__VUE_DEVTOOLS_PORT__ = 8000
84
+
```
85
+
86
+
Or update connect method with new port:
87
+
```
88
+
devtools.connect(/* host */, 8000)
89
+
```
90
+
91
+
**2. How to remotely inspect page on the server?**
92
+
93
+
For that you can use `ngrok` proxy. You can download it [here](https://ngrok.com/).
94
+
95
+
Once you start vue-devtools run:
96
+
```
97
+
ngrok http 8098
98
+
```
99
+
100
+
Then update your host and port accordingly:
101
+
```
102
+
devtools.connect('example.ngrok.io', null)
103
+
```
104
+
105
+
Make sure to set port to `null` or `false`, because ngrok host already proxies to proper port that we defined in the first command.
106
+
107
+
**3. How to inspect page served through `HTTPS`?**
108
+
109
+
For that you can also use ngrok, as it automatically proxies https requests to http. Take a look at question number 2 for instructions.
0 commit comments