@@ -165,7 +165,7 @@ impl BackendModel for LLamaEdgeApiServer {
165
165
166
166
let file_id = file. id . to_string ( ) ;
167
167
168
- let url = format ! ( "http://127.0.0.1 :{}/echo" , listen_addr. port( ) ) ;
168
+ let url = format ! ( "http://localhost :{}/echo" , listen_addr. port( ) ) ;
169
169
170
170
let file_ = file. clone ( ) ;
171
171
@@ -176,7 +176,13 @@ impl BackendModel for LLamaEdgeApiServer {
176
176
async_rt. spawn ( async move {
177
177
let mut test_server = false ;
178
178
for _i in 0 ..600 {
179
- let r = reqwest:: get ( & url) . await ;
179
+ let r = reqwest:: ClientBuilder :: new ( )
180
+ . no_proxy ( )
181
+ . build ( )
182
+ . unwrap ( )
183
+ . get ( & url)
184
+ . send ( )
185
+ . await ;
180
186
if let Ok ( resp) = r {
181
187
if resp. status ( ) . is_success ( ) {
182
188
test_server = true ;
@@ -219,14 +225,17 @@ impl BackendModel for LLamaEdgeApiServer {
219
225
) -> bool {
220
226
let is_stream = data. stream . unwrap_or ( false ) ;
221
227
let url = format ! (
222
- "http://127.0.0.1 :{}/v1/chat/completions" ,
228
+ "http://localhost :{}/v1/chat/completions" ,
223
229
self . listen_addr. port( )
224
230
) ;
225
231
let mut cancel = self . running_controller . subscribe ( ) ;
226
232
227
233
async_rt. spawn ( async move {
228
234
let request_body = serde_json:: to_string ( & data) . unwrap ( ) ;
229
- let resp = reqwest:: Client :: new ( )
235
+ let resp = reqwest:: ClientBuilder :: new ( )
236
+ . no_proxy ( )
237
+ . build ( )
238
+ . unwrap ( )
230
239
. post ( url)
231
240
. body ( request_body)
232
241
. send ( )
@@ -284,8 +293,13 @@ impl BackendModel for LLamaEdgeApiServer {
284
293
}
285
294
286
295
fn stop ( self , _async_rt : & tokio:: runtime:: Runtime ) {
287
- let url = format ! ( "http://127.0.0.1:{}/admin/exit" , self . listen_addr. port( ) ) ;
288
- let _ = reqwest:: blocking:: get ( url) ;
296
+ let url = format ! ( "http://localhost:{}/admin/exit" , self . listen_addr. port( ) ) ;
297
+ let _ = reqwest:: blocking:: ClientBuilder :: new ( )
298
+ . no_proxy ( )
299
+ . build ( )
300
+ . unwrap ( )
301
+ . get ( url)
302
+ . send ( ) ;
289
303
let _ = self . model_thread . join ( ) ;
290
304
}
291
305
}
0 commit comments