๐Ÿž
toasterrelay.whf.bz
RELAY ONLINE
// TOASTER RELAY v1.0

HTTPโ†’HTTPS
Bridge for Legacy
J2ME Hardware

Old phones can't speak TLS. This relay can. A lightweight PHP proxy that sits between your retro J2ME device and any modern HTTPS API โ€” no SSL headaches on the handset side.

Device
๐Ÿ“ฑ J2ME / Symbian
โ”€โ”€HTTPโ”€โ”€โ–ถ
This server
relay.php
โ”€โ”€HTTPSโ”€โ–ถ
Bridge
โ˜๏ธ CF Pages
โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ
Destination
๐Ÿค– API / Service

Why a relay?

Legacy J2ME devices (Nokia, SonyEricsson, early Androids) ship with ancient TLS stacks that fail handshakes against modern servers. The relay accepts plain HTTP from the phone, forwards the request over HTTPS to a Cloudflare Pages bridge, which in turn talks to any upstream API. The phone never touches TLS โ€” the relay handles everything.

๐Ÿ”’

SSL offload

The relay uses CURLOPT_SSL_VERIFYPEER = false intentionally โ€” it's the boundary where HTTP becomes HTTPS so old devices don't have to.

๐Ÿชช

UID routing

Every request carries a ?uid= parameter that identifies the session. The bridge uses it to match responses back to the correct device.

๐Ÿ“ฌ

POST passthrough

GET and POST are both forwarded transparently. POST bodies and Content-Type: application/json headers are preserved end-to-end.

โšก

Zero config on device

Point the MIDlet at http://toasterrelay.whf.bz/relay.php and you're done. No certificates, no keytool, no MIDP 2.0 drama.

Endpoints

All requests go to relay.php. The relay always mirrors the HTTP status code and content-type from the upstream response.

Method Path Parameters Description
GET /relay.php ?uid=
Session token
Poll the bridge for a pending response for this UID
POST /relay.php ?uid= + JSON body
Session token + payload
Send a JSON payload upstream via the bridge (BYOT flow)
๐Ÿ”‘
BYOT โ€” Bring Your Own Token

To use a custom API key, POST a JSON body with your credentials. The relay forwards it as-is to the Cloudflare bridge which authenticates upstream. Your key never touches this server's logs in plaintext โ€” it passes through in the request body.

Connecting a MIDlet

From any J2ME HttpConnection, replace your target URL with the relay and pass your session UID.

Example.java โ€” J2ME HttpConnection
// Open a plain HTTP connection โ€” no TLS needed on the device
String uid = "mySession123";
String url = "http://toasterrelay.whf.bz/relay.php?uid=" + uid;

HttpConnection conn = (HttpConnection) Connector.open(url);
conn.setRequestMethod(HttpConnection.GET);

int responseCode = conn.getResponseCode();
// responseCode mirrors what the upstream API returned

InputStream is = conn.openInputStream();
// read JSON response normally...
Error response format
// If something goes wrong the relay always returns JSON:
{ "error": "Relay: Missing UID" }
{ "error": "Relay cURL Error: ..." }

Deploy your own relay

The relay is a single PHP file. Any shared host with cURL works.

relay.php โ€” one config line
// 1. Edit the bridge URL at the top of relay.php
$CLOUDFLARE_BRIDGE = "https://your-project.pages.dev/api/bridge";

// 2. Upload relay.php to your HTTP hosting
// 3. Point your MIDlet at http://yourdomain.tld/relay.php
// That's it. No composer, no npm, no Docker.