mgedmin / restview

ReStructuredText viewer

Home Page:https://pypi.python.org/pypi/restview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

does not work in vagrant box

vascoosx opened this issue · comments

I tried specifying a forwarded port with option 'l' but it did not work.

I cannot reproduce. Here's what I tried:

  1. vagrant ssh
  2. virtualenv /tmp/sandbox
  3. /tmp/sandbox/pip install restview
  4. /tmp/sandbox/bin/restview somefile.txt
Listening on http://localhost:50309/
  1. Typed ~C to open the SSH command line, typed -L 50309:localost:50309, pressed Enter
  2. Ctrl-clicked on the URL in my terminal to open it in a web browser

What happens:

127.0.0.1 - - [24/Sep/2014 08:16:16] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [24/Sep/2014 08:16:16] "GET /favicon.ico HTTP/1.1" 200 -

shows up in the terminal running vagrant ssh, my web browser displays the rendered ReST file.

I've also tried restview -l 8089 to see if the -l option worked at all, and it did.

I'm at a loss.

Exactly what did you do, what did you expect to happen, and what happened instead?

I tried specifying the port forwarding in the Vagrantfile. I also did a vagrant reload and also configured virtualbox. I guess the problem lies in vagrant. I'll stick with your workaround. Thanks.

I can reproduce!

Vagrant port forwarding forwards ports to guest's eth0, not to guest's loopback. Since restview listens on the loopback interface by default, it won't get any requests.

You can make use of Vagrant's port forwarding if you tell restview to listen on all interfaces with

restview -l 0:8000

(assuming 8000 is the port you want to use).

By the way the decision to make restview listen on loopback by default is based on security: if you're sitting in a cafe it might be a bad idea to let random people on the same network see whatever possibly confidential documents you're previewing.

It worked! Thanks. ipython notebook on the other hand worked without specifying anything so people must be cautious when working with it outside.