22 crate :: component:: bindings:: {
33 fastly:: adapter:: adapter_http_req,
44 fastly:: compute:: http_downstream:: Host as HttpDownstream ,
5- fastly:: compute:: { http_req, types} ,
5+ fastly:: compute:: { http_body , http_req, http_resp , types} ,
66 } ,
77 crate :: {
88 error:: Error ,
@@ -28,14 +28,14 @@ impl adapter_http_req::Host for ComponentCtx {
2828 HttpDownstream :: fastly_key_is_valid ( self , self . ds_req_handle ( ) )
2929 }
3030
31- fn redirect_to_websocket_proxy_deprecated (
31+ fn redirect_to_websocket_proxy_norequest (
3232 & mut self ,
3333 _backend : String ,
3434 ) -> Result < ( ) , types:: Error > {
3535 Err ( Error :: NotAvailable ( "Redirect to WebSocket proxy" ) . into ( ) )
3636 }
3737
38- fn redirect_to_grip_proxy_deprecated (
38+ fn redirect_to_grip_proxy_norequest (
3939 & mut self ,
4040 backend_name : String ,
4141 ) -> Result < ( ) , types:: Error > {
@@ -155,4 +155,90 @@ impl adapter_http_req::Host for ComponentCtx {
155155 }
156156 . into ( ) )
157157 }
158+
159+ fn redirect_to_websocket_proxy (
160+ & mut self ,
161+ handle : Resource < http_req:: Request > ,
162+ backend : String ,
163+ ) -> Result < ( ) , types:: Error > {
164+ crate :: component:: http_req:: redirect_to_websocket_proxy ( & mut self . session , handle, & backend)
165+ }
166+
167+ fn redirect_to_grip_proxy (
168+ & mut self ,
169+ req_handle : Resource < http_req:: Request > ,
170+ backend_name : String ,
171+ ) -> Result < ( ) , types:: Error > {
172+ crate :: component:: http_req:: redirect_to_grip_proxy (
173+ & mut self . session ,
174+ req_handle,
175+ & backend_name,
176+ )
177+ }
178+
179+ fn upgrade_websocket ( & mut self , backend : String ) -> Result < ( ) , types:: Error > {
180+ crate :: component:: http_req:: upgrade_websocket ( & mut self . session , & backend)
181+ }
182+
183+ async fn send (
184+ & mut self ,
185+ h : Resource < http_req:: Request > ,
186+ b : Resource < http_body:: Body > ,
187+ backend_name : String ,
188+ ) -> Result < http_resp:: ResponseWithBody , http_req:: ErrorWithDetail > {
189+ crate :: component:: http_req:: send ( & mut self . session , h, b, & backend_name) . await
190+ }
191+
192+ async fn send_uncached (
193+ & mut self ,
194+ h : Resource < http_req:: Request > ,
195+ b : Resource < http_body:: Body > ,
196+ backend_name : String ,
197+ ) -> Result < http_resp:: ResponseWithBody , http_req:: ErrorWithDetail > {
198+ crate :: component:: http_req:: send_uncached ( & mut self . session , h, b, & backend_name) . await
199+ }
200+
201+ async fn send_async (
202+ & mut self ,
203+ h : Resource < http_req:: Request > ,
204+ b : Resource < http_body:: Body > ,
205+ backend_name : String ,
206+ ) -> Result < Resource < http_req:: PendingRequest > , types:: Error > {
207+ crate :: component:: http_req:: send_async ( & mut self . session , h, b, & backend_name) . await
208+ }
209+
210+ async fn send_async_uncached (
211+ & mut self ,
212+ h : Resource < http_req:: Request > ,
213+ b : Resource < http_body:: Body > ,
214+ backend_name : String ,
215+ ) -> Result < Resource < http_req:: PendingRequest > , types:: Error > {
216+ crate :: component:: http_req:: send_async_uncached ( & mut self . session , h, b, & backend_name)
217+ . await
218+ }
219+
220+ async fn send_async_uncached_streaming (
221+ & mut self ,
222+ h : Resource < http_req:: Request > ,
223+ b : Resource < http_body:: Body > ,
224+ backend_name : String ,
225+ ) -> Result < Resource < http_req:: PendingRequest > , types:: Error > {
226+ crate :: component:: http_req:: send_async_uncached_streaming (
227+ & mut self . session ,
228+ h,
229+ b,
230+ & backend_name,
231+ )
232+ . await
233+ }
234+
235+ async fn send_async_streaming (
236+ & mut self ,
237+ h : Resource < http_req:: Request > ,
238+ b : Resource < http_body:: Body > ,
239+ backend_name : String ,
240+ ) -> Result < Resource < http_req:: PendingRequest > , types:: Error > {
241+ crate :: component:: http_req:: send_async_streaming ( & mut self . session , h, b, & backend_name)
242+ . await
243+ }
158244}
0 commit comments