pub_proxy_server 0.1.2 copy "pub_proxy_server: ^0.1.2" to clipboard
pub_proxy_server: ^0.1.2 copied to clipboard

Dart 1 only

Pub server and pub proxy server. Run your private pub server and publish your private package. Act as a proxy to pub.dartlang.org.

pub_proxy_server #

Private pub repository and proxy server.

Publish private package to your local server.

Act as proxy for pub.dartlang.org or any pub server.

Private and public packages all accessible through pub command line.

pub publish --server http://me:mypassword@127.0.0.1:8042

pub publish --server https://me:mypassword@127.0.0.1

pub get

Installation #

Add this package to your pubspec.yaml file:

dependencies:
  pub_proxy_server: any

Then, run pub install to download and link in the package.

Set PUB_HOSTED_URL environent variable to http://me:mypassword@127.0.0.1:8042

import 'package:logging/logging.dart';
import 'package:pub_proxy_server/pub_proxy_server.dart';
import 'dart:io';

void main() {
  initLog();
  PermissionStore store = new PermissionStore();
  store.addPermission(new UserPermission("me", "mypassword"));
  store.addPermission(new UserPermission("me@gmail.com", "")); //necessary to publish

  var repos = [new PubRepoImpl(new Store(new StoreSettings.fromDir("C:/Users/me/Google Drive/pub_repo","C:/Users/me/pub_repo_tmp"))), 
                 new DartLangRemoteRepo(new Store(new StoreSettings.fromRepoDirPrefix('cache')), new HttpClient())];
  PubFederatedRepo pubrepo = new PubFederatedRepo(repos);
  start_pub_proxy_server(pubrepo, port:8042, permissionStore:store, isSecure:false);
//  InitializeSSL();
//  start_pub_proxy_server(pubrepo, port:443, permissionStore:store, isSecure:true);
}
 
initLog(){
  Logger.root.level = Level.ALL;
  Logger.root.onRecord.listen((LogRecord rec) {
    print('${rec.level.name}:${rec.loggerName}: ${rec.time}: ${rec.message}');
    if (rec.error != null) print(rec.error);
    if (rec.stackTrace != null) print(rec.stackTrace);
  });
}

void InitializeSSL() {
  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
  SecureSocket.initialize(database: testPkcertDatabase, password: 'a');
}
}

Roadmap #

Web admin pages

0
likes
25
pub points
0%
popularity

Publisher

unverified uploader

Pub server and pub proxy server. Run your private pub server and publish your private package. Act as a proxy to pub.dartlang.org.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

Dependencies

crypto, http_server, logging, path, route, route_hierarchical, yaml

More

Packages that depend on pub_proxy_server