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

Commit b716353

Browse files
authored
Merge pull request #175 from exoego/agent-eventemitter
Agent should extend EventEmitter
2 parents 29a25f2 + 31388c8 commit b716353

File tree

1 file changed

+4
-6
lines changed
  • app/current/src/main/scala/io/scalajs/nodejs/http

1 file changed

+4
-6
lines changed

app/current/src/main/scala/io/scalajs/nodejs/http/Agent.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.scalajs.nodejs
22
package http
33

4+
import io.scalajs.nodejs.events.IEventEmitter
45
import io.scalajs.util.PromiseHelper._
56

67
import scala.concurrent.Future
@@ -16,16 +17,11 @@ import scala.scalajs.js.annotation.JSImport
1617
*/
1718
@js.native
1819
@JSImport("http", "Agent")
19-
class Agent(options: AgentOptions = js.native) extends js.Object {
20+
class Agent(options: AgentOptions = js.native) extends IEventEmitter {
2021
/////////////////////////////////////////////////////////////////////////////////
2122
// Properties
2223
/////////////////////////////////////////////////////////////////////////////////
2324

24-
/**
25-
* The agent's domain name
26-
*/
27-
def domain: String = js.native
28-
2925
/**
3026
* An object which contains arrays of sockets currently awaiting use by the Agent when HTTP KeepAlive is used. Do not modify.
3127
* @example agent.freeSockets
@@ -112,5 +108,7 @@ object Agent {
112108
def createConnectionFuture(options: ConnectionOptions): Future[js.Any] = {
113109
promiseWithError1[Error, js.Any](agent.createConnection(options, _))
114110
}
111+
112+
@inline def onKeylog(handler: () => Any): agent.type = agent.on("keylog", handler)
115113
}
116114
}

0 commit comments

Comments
 (0)