weinre - Muli-User

clone weinre at apache

# weinre - Muli-User

weinre was originally designed so that each user that wanted to use weinre would run their own weinre server. The system has since been enhanced to support muliple users using the same server.

## Your debug id

To use a multi-user server, you'll need to select an id for yourself. This id will be used in the client and target URLs of weinre to scope your clients and targets from the clients and targets of other users.

There is no password, just an id. There is no real security here. The id is a secret shared between your debug target and client, but it is sent in the clear when your target and client connect to the server. If someone else knows your id, they can connect to clients or targets you are running with that id.

So don't give your id to anyone else that you don't want to share with.

To keep your id's familar but non-guessable, you might use a string consisting of your typical userid, followed by a dash, followed by another string not likely to be guessed by other people.

If you are paranoid, you can change your id every time you start a debug session, of course.

## Using your id with the client

Typically when start a weinre client session by visiting a URL like

    http://some.server.xyz/client/

To start a client with a particular id, append the hash character (`#`) and the id you want to use the URL. For instance, to connect with the id `itsReallyMe`, launch the client with the URL

    http://some.server.xyz/client/#itsReallyMe

The id which is used will be displayed in the connected clients list for each connected client.

## Using your id with the target

As with the server, append the hash character (`#`) to the URL of the script being injected into your web page. If you had previously used a <script src> element of:

    <script src="http://some.server.xyz/target/target-script-min.js"></script>

use this script element to connect with id `itsReallyMe`

    <script src="http://some.server.xyz/target/target-script-min.js#itsReallyMe"></script>

## Notes

- The weinre server always runs in multi-user mode. If you don't otherwise specify an id, the value of `anonymous` will be used for the id.
- The id is passed in the HTTP body of a POST request during the initial connection of the target and client to the server, and is not sent thereafter. Thus, it should remain out of view in server logs and the like, though it will be visible for anyone who has access to the contents of HTTP request bodies.
- There is no programmatic interface in weinre to list id's in current use, for security reasons. From the Remote panel of weinre, each connected client and target have their channel and id's listed, if you can't remember what id you used with the client.