View Single Post
Old 01-25-2010, 07:26 PM   #1
JoeFloyd
Junior Member
JoeFloyd doesn't litterJoeFloyd doesn't litter
 
Posts: 9
Karma: 112
Join Date: Sep 2009
Device: kindle
Howto: Access Calibre Content Server from Kindle web browser

I've discovered how to easily access the Calibre Content Server from the Kindle web browser. This will allow you to search your Calibre library, and download supported formats directly from you home computer to Kindle using the wireless connection.

In effect, your entire Calibre library of supported formats can be accessed directly from your Kindle.


There are few problems that I had to work around.

First, my ISP blocks incoming port 80 traffic. This means I can't run a web server on a standard port.

Second, the Kindle doesn't seem to allow arbitrary port numbers to be entered into the web address of the browser.

Third, the Calibre Content Server doesn't want to use restricted ports (1-1024) on all of the versions of windows that I've tried.


Each of these problems require a workaround.



Start by setting up the Calibre Content Server
1) Assign a port (default is 8080)
2) provide a user name and password


Start the Calibre Content Server and verify that the you can see web page being generated by Calibre.

Using your web browser you can direct it to your local machine running Calibre by entering 127.0.0.1:8080 into the web address. You should be prompted for the user name and password you entered into the Calibre Content Server setup dialog.


OK, now the tricky part is that the Kindle web browser will not allow arbitrary ports to be specified as part of the web address. For instance, if you try to go to a web site with and address of the form.

http://www.google.com:8080

The browser will return an error.

As far as I know, the browser is restricting the web port to the default value of 80.

http://www.google.com:80

This will work.

Now, the interesting thing.

http + ssl is web traffic over a secure socket connection. This is usually directed to port 443

For example, when you use a web address of the form

https://www.google.com

This will connect to port 443 not port 80.

You can also entered a web address of the form;

http://www.google.com:443

What's interesting about this is that the web browser will attempt to connect to the server at port 443, but not over a secure socket!!!

My ISP does not block port 443, so I can use a web address of the form

http://my.ip.address:443

This will connect to my computer running the Calibre Content Server on port 443.

Now, the problem is to somehow get Calibre to respond to requests on port 443. I couldn't figure out how to configure Calibre to allow this, so I went looking for some software to forward connections from one port to another port.


What I found was a windows application called Port Forwarding For Windows.

http://www.quantumg.net/portforward.php

This software will forward incoming connections on a given port to a host(can be the same machine) with a different port.

There isn't much to this software. When you run it, the GUI won't show much of anything. On the application menu, you click Redirection -> Add
This will bring up a dialog that has three boxes.

The first box is the external port that the Kindle will use to connect to this machine. In this case, the port is 443.

The second box is destination. This box should be the IP address of the machine running Calibre. On your home network, the router/gateway may have automatically assigned the IP address of the computer using DHCP. You can find the IP address by opening a cmd window and executing the ipconfig command.

The last box is the port you entered into the Calibre Content Server setup GUI.

When this is configured correctly, you should be able to use a web browser on you local computer to browse the Calibre using the port 443.

127.0.0.1:443

Port Forwarding For Windows GUI will show a number of connections being made while the web browser is connecting to Calibre.

The final step is to open the port 443 on you broadband router/gateway. Each manufacture has a different way of doing this, but in the majority of cases you want to go to the port forwarding setting of the router and add a rule to foward port 443 to the machine running Calibre and the Port Forwarding For Windows application.


Now from the Kindle type the public IP address of your router (this can be found using the router web interface) or setup a free DynDNS account to allow the use of fixed hostname.

http://my.ip.address:443

A dialog will appear on the Kindle asking for the user name a password you entered into the Calibre Content Server setup GUI. Once you enter the correct user name and password, the Calibre web interface will load.

It's extremely slow, but it works. You can download a book by selecting one of the supported formats (txt, mobi, prc, html). The browser will download the file and the next time you go to your home screen the new book will appear at the top of the list.

Hope this works for you.

Last edited by JoeFloyd; 01-25-2010 at 07:46 PM. Reason: Update title
JoeFloyd is offline   Reply With Quote