Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP hijacking (for Node WS/CONNECT, etc...) #12718

Closed
piscisaureus opened this issue Nov 9, 2021 · 7 comments · Fixed by #13618
Closed

HTTP hijacking (for Node WS/CONNECT, etc...) #12718

piscisaureus opened this issue Nov 9, 2021 · 7 comments · Fixed by #13618
Assignees

Comments

@piscisaureus
Copy link
Member

No description provided.

@piscisaureus piscisaureus self-assigned this Nov 9, 2021
@ry ry mentioned this issue Jan 4, 2022
18 tasks
@stale
Copy link

stale bot commented Jan 8, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@jimmywarting
Copy link
Contributor

jimmywarting commented Mar 2, 2022

how about something service-worker ish implementation?

/** @param {FetchEvent} evt */
function handleFetch (evt) {
  const { request, respondWith } = evt
  respondWith( new Response(...) )
}

globalThis.onfetch = handleFetch

@bartlomieju
Copy link
Member

how about something web-worker ish implementation?

/** @param {FetchEvent} evt */
function handleFetch (evt) {
  const { request, respondWith } = evt
  respondWith( new Response(...) )
}

globalThis.onfetch = handleFetch

@jimmywarting is onfetch specced anywhere or is just an idea?

@jimmywarting
Copy link
Contributor

@crowlKats
Copy link
Member

I dont see how that is relevant to this issue. that is just the fetch event that we have on deploy, it has nothing to do with this

@jimmywarting
Copy link
Contributor

then i must have misinterpreted what the issue is about, i tough it was to hijack/intercept a ongoing request

eg: making a fetch call to get something would trigger a fetch event that you could use to monitor/log all outgoing request. (unless that's what PerformanceEventTiming will be for, but a fetch event could for higher level stuff

globalThis.onfetch = evt => {
  // hijiack the request and respond with mocked data instead
}

fetch('https://httpbin.org/get') // would trigger a fetch event

@crowlKats
Copy link
Member

Ah, no this is something completely different, though the issue name is not great and there isnt a description, so cant blame you.
Basically this is about an API to get the underlying tcp/tls stream of a request, so one can implement custom protocols that are based on http (ie websocket)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants