Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to make preview work on remote server? #92

Closed
y9c opened this issue May 3, 2016 · 7 comments
Closed

how to make preview work on remote server? #92

y9c opened this issue May 3, 2016 · 7 comments

Comments

@y9c
Copy link

y9c commented May 3, 2016

I write makedown file on a remote server through ssh portal. The server has a public IP address and all the ports are accessable.

when I press F12 to activate preview mode, I can visit the webpage though "ip:port", but the page is empty.

@y9c y9c changed the title how to make preview work how to make preview work on May 3, 2016
@y9c y9c changed the title how to make preview work on how to make preview work on remote server? May 3, 2016
@hallzy
Copy link

hallzy commented May 19, 2016

+1

@hallzy
Copy link

hallzy commented May 19, 2016

btw... I found a pull request on the server repo for this project and someone had made a change to make this work. You can try using that. I also have a fork that has this change and also does not open up a browser automatically (I found that only one browser can connect to the socket at once so if you are trying to open a browser from a local machine of a markdown file on a server, the server would try to open up its own web browser, and if it connects your local browser would not connect. So I just disabled it to make it easier). You can find it here.

Feel free to use it, or make the change yourself. The PR I am referring to is here.

if you decide to use mine instead, you need to install it again obviously. The npm command would now be sudo npm -g install hallzy/instant-markdown-d

@suan
Copy link
Collaborator

suan commented May 20, 2016

instant-markdown/instant-markdown-d#29 has been merged which partially solves this. However as @hallzy alludes to you still need a way to prevent the initial browser open. Open to suggestions on how we can improve the experience for this use-case, perhaps allowing multiple sockets/browser windows, so you can open/close browser windows at will and things will still work?

@hallzy
Copy link

hallzy commented May 20, 2016

That is what I would have liked to do, but I am not very familiar with almost any of this so I would not even know where to start. I think being able to open multiple browsers connected to the same socket would be nice.

I have not tried to do this through ssh with a computer running something like ubuntu-server though, which to my understanding does not have a web browser, so if we still open up the browser automatically in this situation I don't know what would happen (ie, would it just fail to open, or would it cause the whole thing to fail and we can't even connect from a different computer now?)

So if it is determined that we can do this and have no problems, then we can do that, otherwise there may need to be another way to say that we don't want the browser opening up automatically, or at least if it fails to open up a browser, we can still continue.

I like the idea of having a tab open up automatically in general so it would be nice to keep that feature I think. We just need a way to make sure that it wont have a negative effect on anything over ssh if we allow multiple browsers to connect to the same socket, or we would need to be able to tell it not to open it.

What I personally would like in a perfect world, is the ability to open a number of browsers connected to that socket, and let it try to open up a browser automatically, and if it fails because it is a terminal based OS and does not have a browser, that the application won't fail and I can still connect from another browser. This way I would still have the ability to open a browser automatically, but I can also work over ssh.

@suan
Copy link
Collaborator

suan commented May 20, 2016

Yes @hallzy what I have in mind is for the server to initiate a new websocket to whatever sends it a GET request at anytime (which is what opening a browser window with the address will do), and broadcasting to all connected websockets anytime there's a change. That way windows can come and go at anytime and any one of them failing won't affect the rest of them.

I've created a new issue for myself here: instant-markdown/instant-markdown-d#33

@hallzy
Copy link

hallzy commented May 20, 2016

nice! I look forward to it :)

@stale
Copy link

stale bot commented Jan 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Would not fix label Jan 9, 2021
@stale stale bot closed this as completed Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants