Skip to content
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn main() {
fn(req: Request(Connection)) -> Response(ResponseData) {
logging.log(
logging.Info,
"Got a request from: " <> string.inspect(mist.get_client_info(req.body)),
"Got a request from: " <> string.inspect(mist.get_connection_info(req.body)),
)
case request.path_segments(req) {
[] ->
Expand Down
3 changes: 2 additions & 1 deletion examples/complete/src/complete.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ pub fn main() {
fn(req: Request(Connection)) -> Response(ResponseData) {
logging.log(
logging.Info,
"Got a request from: " <> string.inspect(mist.get_client_info(req.body)),
"Got a request from: "
<> string.inspect(mist.get_connection_info(req.body)),
)
case request.path_segments(req) {
[] ->
Expand Down
2 changes: 1 addition & 1 deletion src/mist.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pub type ConnectionInfo {
}

/// Tries to get the IP address and port of a connected client.
pub fn get_client_info(conn: Connection) -> Result(ConnectionInfo, Nil) {
pub fn get_connection_info(conn: Connection) -> Result(ConnectionInfo, Nil) {
transport.peername(conn.transport, conn.socket)
|> result.map(fn(pair) {
ConnectionInfo(
Expand Down