# w3remote version 0.3

## Author

coda

## Summary

w3remote is a program for controlling a Windows computer from a remote location over the internet. It is designed to fulfill a similar purpose to VNC, except without the need for a custom client. Instead, w3remote makes use of lowest-common-denominator standards like HTTP, HTML forms, and CGI. Also unlike VNC, it supports quickly switching between multiple monitors.

## Screenshot

It looks kind of like this.

## Bundled webserver

w3remote is designed to be run from a CGI-capable webserver. It has been tested with Apache, lighttpd, and several other webservers available on Windows. w3remote is bundled with WLMP Project's lighttpd for windows in order to require as little initial setup as possible.

## Port forwarding etc.

In order to be able to access your computer remotely, one of two conditions has to be met:

1. Your computer is directly connected to the internet and has an IP address. You can access w3remote on your computer at `http://(your computer's ip)/`.
2. Your computer is behind a router, and your router is configured to forward incoming requests on the w3remote port (default: 80 for http, 443 for SSL) to your computer. You can access w3remote on your computer at `http://(your router's ip)/`.

Determining your IP and configuring port forwarding are outside of the scope of this document. This site may be helpful.

## Quick installation

- Unzip w3remote-0.1.zip into `C:\`. The directory `w3remote` will be created with all the program's files.
- Open `htpasswd.txt` in a text editor and change the line that says `username:password` into a username and password that other people won't guess.

## Starting w3remote

Start w3remote by running `start-w3r.bat`.

## Stopping w3remote

Open Task Manager (Ctrl+Alt+Del), switch to the Processes tab, and end the lighttpd.exe process.

## Using w3remote

Open `http://(your ip)/` (as stated above in Port forwarding etc.) in a browser on another computer. You should be prompted for your username and password.

Once you are authenticated, you will see a screenshot of your local computer.

### Mouse button actions

If you click on the screenshot, a click will be sent to your local computer. You can change the type of click with the `message` dropdown menu beneath the screen. Selecting `move` will just move the cursor to that position.

### Dragging

You can also hold the mouse button down and drag on the screen to do a drag on your local computer. A red line will indicate the start and end points of the drag. If you decide you want to cancel the drag, drag your mouse away from the starting point and then back as close as possible, and the drag will be cancelled.

### Keyboard actions

#### Normal text

You can send keyboard messages by typing something in the text field and hitting enter. The text you enter will be sent to the local computer, including the enter key.

#### SendKeys sequences

The text field also supports SendKeys-like syntax. For example, `{BACKSPACE}` sends the backspace key. The full list of key names:

Key | Code
--- | ---
BACKSPACE | {BACKSPACE}, {BS}, {BACK}
DELETE | {DEL}
DELETE | {DELETE}
PAGE UP | {PGUP}
PAGE DOWN | {PGDN}
TAB | {TAB}
HOME | {HOME}
END | {END}
ESCAPE | {ESC}
UP | {UP}
DOWN | {DOWN}
DOWN | {DN}
LEFT | {LT}
LEFT | {LEFT}
RIGHT | {RT}
RIGHT | {RIGHT}
RETURN | {ENTER}
RETURN | {RETURN}
SPACE | {SPACE}
RETURN | {~}
F1 | {F1}
F2 | {F2}
F3 | {F3}
F4 | {F4}
F5 | {F5}
F6 | {F6}
F7 | {F7}
F8 | {F8}
F9 | {F9}
F10 | {F10}
F11 | {F11}
F12 | {F12}
PRINT SCREEN | {PRTSC}

Any one-letter code will be interpreted as pressing the letter of the code, e.g. `{b}` will send a 'b'. The SendKeys shift(+), ctrl(^), and alt(%) modifiers are supported as well, so you can type `{^a}` to send Ctrl+A. The repetition modifier that SendKeys has is not supported.

A trailing ENTER keypress will not be sent if you use a SendKeys sequence. If you want to send text without a trailing enter, you may simply add `{}` to the end of the input.

To send a plain open-brace, use `{{}`. To send a plain close-brace, `}` will still work.

### Clipboard

You can inspect the clipboard of the local computer by clicking on the `clipboard contents` link beneath the screen. The file types supported are text and files. This way, you can transfer files from your local computer by copying them (via right-click menu or Ctrl+C in Explorer.)

## Other Configuration

### lighttpd configuration

`lighttpd.conf` contains the settings for the webserver. You can edit it in Notepad or any text editor. If you decide to move w3remote into some other directory, change the `var.root` line to the correct directory. If you want to listen on a port other than 80, change the `server.port` line.

### SSL

OpenSSL is bundled with w3remote so that you can generate a self-signed certificate and use it with lighttpd to serve HTTP over SSL. run `sslgen.bat` and answer the prompts to generate the `server.pem` file. Then you can uncomment the `ssl.engine` and `ssl.pemfile` lines in `lighttpd.conf`.

You must then access w3remote from `https://(your ip)`. Also note that the default port for https is 443, not 80, so you must have port 443 forwarded to your computer if you are behind a router.

Browsers will complain about self-signed certificates, this is normal. If you want to avoid it you have to generate a real certificate somehow, I don't know how that works. You can supress one of Firefox's warnings by entering your IP (or your domain name if you have one that points to your IP) as the "Common Name" in sslgen.

## Troubleshooting

### Black screen

If you have "On resume, display Welcome screen" enabled in Windows XP (in Display Properties > Screen Saver), w3remote won't be able to capture the screen or wake the computer up from screen saver mode. The only solution is to disable this option. The same issue occurs for password-protecting the screen saver on earlier versions of Windows.

### Can't access w3remote

First, check if lighttpd.exe is in the processes list. If it isn't, then lighttpd failed to start. Start menu > Run `cmd /k "c: && cd \w3remote && c:\w3remote\start-w3r.bat"`, and see if there's any error message.

If lighttpd IS in the processes list, then you probably have a port forwarding issue.

## Links

w3remote site with latest version

## Version history

- 0.3 - fixed sending of null char on invalid sendkeys sequence, updated docs
- 0.2 - added middleclick, fixed outdated script.js
- 0.1 - initial release

## License

Copyright (c) 2007 coda/engramstudio.com
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of engramstudio.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.