Most APIs available in Deno CLI are also available in Deno Deploy Subhosting, but some differ in functionality or are unavailable in certain runtime configurations.
Refer to the virtual filesystem chapter.
The network stack in Deno Deploy Subhosting supports outbound networking using TCP (and by extension HTTP). No raw inbound networking is available, but a single TCP listener can be opened to accept inbound HTTP requests / connections.
By default the entire public internet is accessible, but this can be restricted using the permissions settings in the isolate configuration.
For outbound networking, the following APIs are available:
Deno.connect: Connect to a remote host.
Deno.connectTls: Connect to a remote host using TLS.
Deno.startTls: Upgrade an existing TCP connection to TLS.
fetch: Make outbound HTTP requests.
WebSocket: Make outbound WebSocket connections.
To accept incoming HTTP requests, the standard procedure used in Deno CLI is
applicable. A TCP listener is opened with
Deno.listen(), then individual
connections are accepted with
listener.accept(), and then the connection is
upgraded to HTTP with
Deno.listen() may be called at most
once, with any valid port number.
It is recommended that you do not implement the HTTP stack yourself, instead
To upgrade incoming HTTP requests to WebSockets, the standard procedure used in Deno CLI is applicable. More information can be found in the Deno manual.