mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
feat: Add Deno.dialTLS()
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
4ff04ad96f
commit
045e74bb39
12 changed files with 206 additions and 22 deletions
|
@ -44,7 +44,7 @@ function shutdown(rid: number, how: ShutdownMode): void {
|
|||
sendSync(dispatch.OP_SHUTDOWN, { rid, how });
|
||||
}
|
||||
|
||||
class ConnImpl implements Conn {
|
||||
export class ConnImpl implements Conn {
|
||||
constructor(
|
||||
readonly rid: number,
|
||||
readonly remoteAddr: string,
|
||||
|
@ -187,7 +187,6 @@ const dialDefaults = { hostname: "127.0.0.1", transport: "tcp" };
|
|||
export async function dial(options: DialOptions): Promise<Conn> {
|
||||
options = Object.assign(dialDefaults, options);
|
||||
const res = await sendAsync(dispatch.OP_DIAL, options);
|
||||
// TODO(bartlomieju): add remoteAddr and localAddr on Rust side
|
||||
return new ConnImpl(res.rid, res.remoteAddr!, res.localAddr!);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue