1

I'm in China, and I want to upload my dart package to pub.dev

but it's always return

Connection closed before full header was received
pub finished with exit code 69

below ways are what I already tried:

  1. set terminal proxy
 $ export http_proxy=http://127.0.0.1:7890
 $ export https_proxy=$http_proxy
 
 $ curl google.com
 <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
 <TITLE>301 Moved</TITLE></HEAD><BODY>
 <H1>301 Moved</H1>
 The document has moved
 <A HREF="http://www.google.com/">here</A>.
 </BODY></HTML>
  1. edit ~/.bash_profile
# export PUB_HOSTED_URL=https://pub.flutter-io.cn
# export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

then

$ source ~/.bash_profile
  1. then I try to upload
 $ flutter packages pub publish --server=https://pub.dartlang.org
 $ flutter pub publish --server=https://pub.dev

 ...
 # it's return
 Connection closed before full header was received
 pub finished with exit code 69
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.9, on macOS 12.6.1 21G217 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.75.1)
[✓] Proxy Configuration
[✓] Connected device (3 available)
[✓] HTTP Host Availability
张英姿
  • 21
  • 3

0 Answers0