-
Notifications
You must be signed in to change notification settings - Fork 13
Home
darwin edited this page Sep 13, 2010
·
36 revisions
FireLogger content is sent from server to client via HTTP headers. To be safe it is BASE64 encoded UTF-8 JSON broken into multiple FireLogger headers.
Server can send multiple JSONs in one response, I call it packets. That is why each FireLogger header has hex id which should be assigned by server for every new packet (for example FirePython generates this as random ID).
These are main reasons:
- we don’t want to interfere with response content (it may be anything from HTML, javascript, CSS or unknown binary data)
- to keep it simple and safe (opening other communication channel with server would be from non-trivial to impossible – you know firewalls and such)
- JSON is easy for FireLogger addon (Javascript) and every server-side environment has libraries for serialization into JSON, so no big deal here
You have to take care about incoming request headers in your server side library:
- X-FireLogger – presence of this header says that FireLogger is ready to receive your packets, value is FireLogger version
- you must emit packets only if you encounter this header
- you should warn user if there is version mismatch between your library and FireLogger
- X-FireLoggerAuth – authentication token
- you should check against this token if you have password to protect server-side