Skip to content

Conversation

JakeChampion
Copy link
Contributor

@JakeChampion JakeChampion commented Jul 25, 2024

Currently FetchEvent.server contains one property, address, which is the IP address of the server. In the future more properties may be added.

Example usage for this field:

/// <reference types="@fastly/js-compute" /> addEventListener("fetch", event => event.respondWith(app(event))) async function app(event) { return new Response(`Received request on ${event.server.address}`); }

Resolves #853.

@JakeChampion JakeChampion force-pushed the jake/server-ip branch 4 times, most recently from 3c0f3f7 to 3350aa8 Compare July 25, 2024 13:05
@JakeChampion JakeChampion marked this pull request as ready for review July 25, 2024 13:35
@JakeChampion JakeChampion requested a review from guybedford July 25, 2024 13:36
…he server which received the incoming HTTP request from the client. Currently `FetchEvent.server` contains one property, `address`, which is the IP address of the server. In the future more properties may be added. Example usage for this field: ```js /// <reference types="@fastly/js-compute" /> addEventListener("fetch", event => event.respondWith(app(event))) async function app(event) { return new Response(`Received request on ${event.server.address}`); } ```
@guybedford
Copy link
Contributor

@JakeChampion I've pushed up a commit here to fix the CI build issue and also refactor the shared implementation. Feel free to make any further changes as necessary.

@JakeChampion
Copy link
Contributor Author

Thanks @guybedford - I have no other changes I'd make, if you could approve then we can land this 🙏

@guybedford guybedford merged commit 538ed9c into main Jul 29, 2024
@guybedford guybedford deleted the jake/server-ip branch July 29, 2024 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants