Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

[https] Add highWaterMark to RequestOptions , Add agent.onKeylog event hander #242

Merged
merged 1 commit into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ trait RequestOptions extends js.Object {
var secureProtocol: js.UndefOr[String] = js.undefined
var sessionIdContext: js.UndefOr[String] = js.undefined
var insecureHTTPParser: js.UndefOr[Int] = js.undefined
var highWaterMark: js.UndefOr[Int] = js.undefined

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs14)
var maxHeaderSize: js.UndefOr[Int] = js.undefined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.scalajs.nodejs

import com.thoughtworks.enableIf
import io.scalajs.nodejs.buffer.Buffer
import io.scalajs.nodejs.http.{RequestOptions, ServerResponse}
import io.scalajs.util.PromiseHelper._
import io.scalajs.nodejs.url.URL
Expand Down Expand Up @@ -54,4 +56,9 @@ package object https {
promiseCallback1[ServerResponse](https.request(url, options, _))
}
}

implicit final class AgentExtensions[T <: Agent](private val instance: T) extends AnyVal {
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12)
@inline def onKeylog(handler: (Buffer, tls.TLSSocket) => Any): T = instance.on("keylog", handler)
}
}