Closed TheLeoP closed 1 year ago
I can't find the example for deploying a server at all. The link https://github.com/jbyuki/instant.nvim/wiki/Deploy-a-server doesn't seem to exist.
I had a look at the commit history for the wiki page, and it seems the last commit there (as of today June 20, 2022) deleted the file for https://github.com/jbyuki/instant.nvim/wiki/Deploy-a-server. Hard to say if that was an accident or done on purpose because the info there is maybe outdated by now and does not work anymore.
$ git clone https://github.com/jbyuki/instant.nvim.wiki.git
$ cd instant.nvim.wiki/
$ git log --format=reference | head
b022417 (Destroyed Deploy a server (markdown), 2022-05-03)
03e96e2 (Updated Protocol (markdown), 2021-03-06)
ddc33d2 (Updated Protocol (markdown), 2021-03-06)
c232d47 (Updated Protocol (markdown), 2021-03-06)
96c3787 (Updated Commands (markdown), 2021-03-06)
adba71e (Updated Deploy a server (markdown), 2021-01-06)
d3707b7 (Updated Deploy a server (markdown), 2021-01-05)
b9fe3a0 (Updated Deploy a server (markdown), 2021-01-04)
c9d8bde (Updated Deploy a server (markdown), 2021-01-04)
1780f38 (Created Persistent Data (markdown), 2021-01-04)
At any rate, you can revert this deletion as follows. It will restore the Deploy-a-server.md
which seems to contain the instructions.
$ git revert --no-edit b022417
[master dc95d66] Revert "Destroyed Deploy a server (markdown)"
Date: Mon Jun 20 21:59:45 2022 +0200
1 file changed, 90 insertions(+)
create mode 100644 Deploy-a-server.md
I am on Linux, but the ngrok method does not seem to work either. Not sure if the issue is related to that of @TheLeoP, but in my case it does not seem to spit out any errors. It simply does nothing at all. Not even a GET /
appears on ngrok (if I try to curl the link, a GET /
appears).
Please note, I installed this plugin a few minutes ago, maybe I am missing something to get it to work.
If the deletion was intentional, I will be glad to delete this comment. In the meantime it can serve to retrieve the file.
@niveK77pur ngrok does work
:InstantStartServer
:InstantStartSingle 0.0.0.0 8080
ngrok tcp 8080
:InstantJoinSingle 0.tcp.ngrok.io 1821
(for example)@rag-hav Thank you for your message! I see you are using TCP, does it also work for HTTP? (ngrok said I cannot use tcp until I create an account). So I am running ngrok http 8080
instead (PC 1).
Also just to clarify, when you say copy the url it is the one from Forwarding right? In my case it says something like https://1bf0-88-206-141-152.eu.ngrok.io -> http://localhost:8080
(note it says https, not sure if that's an issue. In the example they were showing it says http). So in the second PC I do :InstantJoinSingle 1bf0-88-206-141-152.eu.ngrok.io
and it does nothing. :InstantStatus
says Disconnected. (PC 2); on the first PC it says Connected. 0 other client(s)
The only other difference I see is that you are specifying a port on the second PC (you say 1821
). Is it taken from the Web Interface entry? It says http://127.0.0.1:4040
for me, but adding 4040
or 8080
to the :InstantJoinSingle
command also has no effect. (not sure if the port is specific to tcp in this case).
I just noticed, if I wait long enough after the join command, it eventually spits out this error message about a time out. In case that can help.
Error executing vim.schedule lua callback: ...im/plugged/instant.nvim/lua/instant/websocket_client.lua:92: There was an error during connection: ETIMEDOUT
stack traceback:
[C]: in function 'error'
...im/plugged/instant.nvim/lua/instant/websocket_client.lua:92: in function 'cb'
vim.lua:285: in function <vim.lua:285>
I glanced at the lua/instant/websocket_client.lua
file at line 92 according to the above error. I see that this block of code is running inside a client:connect
which leads me to line 68 where client
is defined. It says
local client = vim.loop.new_tcp()
Does it mean it only works with TCP? I cannot use HTTP to make it work? In which case I might consider making an account to see if it actually works then. Or I might look into the second more complicated looking solution using Heroku if that can make any difference.
@niveK77pur
The only other difference I see is that you are specifying a port on the second PC (you say 1821). Is it taken from the Web Interface entry? It says http://127.0.0.1:4040 for me, but adding 4040 or 8080 to the :InstantJoinSingle command also has no effect. (not sure if the port is specific to tcp in this case).
With ngrok tcp
you get a hostname and a port, which is different from Web Interface. But with HTTP you only get a hostname since the port for HTTP is always 80 by default.
For HTTP do this-
:InstantStartServer
:InstantStartSingle 0.0.0.0 8080
ngrok http 8080
:InstantJoinSingle foobar.ngrok.io 80
(for example)Join
:InstantJoinSingle foobar.ngrok.io 80
(for example)
Thank you again @rag-hav! This port 80 is something that must have slipped my attention. However, I just tried that and still no success :thinking:
I can ping the foobar.ngrok.io
just fine though but running :InstantJoinSingle 1bf0-88-206-141-152.eu.ngrok.io 80
(for example) still reports Disconnected. I am getting unsure now where the issue exactly lies. It doesn't seem to be ngrok from what I gather here, but given what you tell me, it's probably not instant.nvim either... I'm not exactly sure where to look for now to trouble shoot this
@niveK77pur Well just on the off chance that you are making a mistake on some step. Here is a video
https://drive.google.com/file/d/1UJDoKDvJYCfCiTIFzaX3FcgcdvSAgO00/view?usp=sharing
Thank you so much again @rag-hav! I have spotted the culprit thanks to your video. There are 2 things that differ on both our ends.
2.3.40
. Mine is 3.0.5
. But I believe this not to be an issue.I see the URL is otherwise the same, so I suppose the issue is that I am not receiving an http tunnel (which seems to be part of the free subscription).
I have just gone ahead and created an ngrok account because it does seem quite cool. And I got it to work with TCP now!
However, I still don't see the http forwarding for ngrok, only https. I suppose there is an issue with my ngrok? or I need to configure something? or is it because I am in the EU? This is not related to this plugin anymore though.
Also keep in mind, I did not open this issue. So I am not sure if my discoveries here could help resolve the initial problem raised.
I just download this plugin today and the local editing works great. But I tried to follow the example of deploying a server using
ngrok
and it just don't works without giving me any errors.I was trying to debug the code and I arrived at
lua/instant/websocket_client.lua
inside the methodws:connect
, on the callback, onclient:read_start
it turns out thathttp_chunk
does not match the expression"\r\n\r\n$"
since the value is something similar to:What confuses me the most is that using ngrok Web interface (
https://localhost:4040
) it doesn't even shows an http request being made but if I open the same URL on a web browser, it shows a Get request.I thought this could be a firewall problem, so I turned it off and tryed again, but I got the same result.
Side note: what are the [something].lua.t files on
src/
I found that you have a plugin to compile them to lua or (i think) vimscript, but what language/format are they? I tried to google it and just find something about Turing files.