Skip to content

Commit 01b9706

Browse files
committed
add @http.ServerConnection::client_addr
1 parent 51df12f commit 01b9706

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/http/pkg.generated.mbti

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ fn Server::new(@socket.Addr, dual_stack? : Bool, reuse_addr? : Bool, headers? :
117117
async fn Server::run_forever(Self, async (Request, &@io.Reader, ServerConnection) -> Unit, allow_failure? : Bool, max_connections? : Int) -> Unit
118118

119119
type ServerConnection
120+
fn ServerConnection::client_addr(Self) -> @socket.Addr
120121
fn ServerConnection::close(Self) -> Unit
121122
async fn ServerConnection::end_response(Self) -> Unit
122123
async fn ServerConnection::entre_passthrough_mode(Self) -> Unit

src/http/server.mbt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ pub fn ServerConnection::close(self : ServerConnection) -> Unit {
4242
self.conn.close()
4343
}
4444

45+
///|
46+
/// Get the address of client from a HTTP server connection
47+
pub fn ServerConnection::client_addr(self : ServerConnection) -> @socket.Addr {
48+
self.conn.addr()
49+
}
50+
4551
///|
4652
pub impl @io.Reader for ServerConnection with _direct_read(
4753
self,

0 commit comments

Comments
 (0)