Any chance to access a beta/early version of worker-for-platforms without being enterprise?
Any chance to access a beta/early version of worker-for-platforms without being enterprise?
npm 

yourdomain.com/* -> None*.yourdomain.com/* -> None*/* -> The Worker To Route Custom Hostnames



* for the worker route which catches all custom hostnames.
new ReadableStream() is working for me in normal workers, but not workers for platformsError: To use the new ReadableStream() constructor, enable the streams_enable_constructors compatibility flag. Refer to the docs for more information: https://developers.cloudflare.com/workers/platform/compatibility-dates/#compatibility-flagsI was hoping it would be as simple as:
compatibility_flags = ['streams_enable_constructors']wrangler.toml , I get the following error:The compatibility flag streams_enable_constructors became the default as of 2022-11-30 so does not need to be specified anymore. [code: 10021]Current compatibility date (for both platform code, and customer workers):
compatibility_date = "2024-02-21"DELETE to https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/dispatch/namespaces/{namespace}/scripts/{script_name}/secrets/Example ExampleX{
method: 'POST',
headers: {
'X-Auth-Email': <GLOBAL_API_KEY>,
'X-Auth-Key': <GLOBAL_API_KEY>,
'Content-Type': 'application/json'
},
body: '{"hostname":"app.example.com","ssl":{"bundle_method":"ubiquitous","certificate_authority":"google","method":"txt","settings":{"ciphers":["ECDHE-RSA-AES128-GCM-SHA256","AES128-SHA"],"early_hints":"on","http2":"on","min_tls_version":"1.2","tls_1_3":"on"},"type":"dv","wildcard":true}}'
}
https://api.cloudflare.com/client/v4/zones/<MY_ZONE_ID>/custom_hostnames
{
success: false,
errors: [ { code: 10000, message: 'Authentication error' } ]
}async function createCustomHostname(c: Context) {
const { CF_API_KEY, CF_ZONE_ID } = env<{ CF_API_KEY: string, CF_ZONE_ID: string }>(c)
const content = await c.req.json<any>();
const headers = {
'Authorization': `Bearer ${CF_API_KEY}`,
'Content-Type': 'application/json',
};
try {
const options = {
method: 'POST',
headers: headers,
body: JSON.stringify({
"hostname": content.url,
"ssl": {
"bundle_method": "ubiquitous",
"method": "txt",
"settings": {
"ciphers": ["ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"],
"early_hints": "on",
"http2": "on",
"min_tls_version": "1.2",
"tls_1_3": "on"
},
"type": "dv",
"wildcard": false
}
})
};
const response = await fetch(`${BASE_URL}/zones/${CF_ZONE_ID}/custom_hostnames`, options)
const json = await response.json()
return json
} catch (error) {
console.error(`Error creating custom hostname: ${error}`);
throw error;
}
}result: {
id: '85efa926-8179-4c81-926e-eced6009ad63',
hostname: 'test.exampleDomain.com',
ssl: {
id: 'de9b5334-8757-4b5f-85a9-5bcf3a4f0919',
type: 'dv',
method: 'txt',
status: 'initializing',
settings: [Object],
wildcard: false,
certificate_authority: 'google'
},
status: 'pending',
ownership_verification: {
type: 'txt',
name: '_cf-custom-hostname.test.exampleDomain.com',
value: '7bd6536e-dc3d-46ba-974a-9e608090a3aa'
},
ownership_verification_http: {
http_url: 'http://test.exampleDomain.com/.well-known/cf-custom-hostname-challenge/85efa926-8179-4c81-926e-eced6009ad63',
http_body: '7bd6536e-dc3d-46ba-974a-9e608090a3aa'
},
created_at: '2024-01-31T19:55:43.182431Z'
},
success: true,
errors: [],
messages: []
}{
"name": "Example",
"text": "example",
"type": "secret_text"
}{
"result": null,
"success": false,
"errors": [
{
"code": 10013,
"message": "workers.api.error.unknown"
}
],
"messages": []
}{
"code": 10056,
"message": "workers.api.error.binding_not_found"
}curl --location --request DELETE 'https://api.cloudflare.com/client/v4/accounts/<ACCOUNT>/workers/scripts/worker-restless-wave-3410/secrets/my-secret' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <TOKEN>'{
"type": "queue",
"name": "<TEST_QUEUE>",
"queue_name": "<TEST_QUEUE_NAME>"
}