Skip to content

Commit

Permalink
CHANGE DEFAULT PORT TO 8765
Browse files Browse the repository at this point in the history
  • Loading branch information
amark committed Jul 30, 2018
1 parent 0437235 commit d65e2c3
Show file tree
Hide file tree
Showing 45 changed files with 603 additions and 52 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ RUN apk update && apk upgrade \
&& npm install \
&& apk del .build-dependencies && rm -rf /var/cache/* /tmp/npm*
EXPOSE 8080
EXPOSE 8765
CMD ["npm","start"]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Then visit the URL in the output of the 'now --npm' step, in your browser.
Pull from the [Docker Hub](https://hub.docker.com/r/gundb/gun/) [![](https://images.microbadger.com/badges/commit/gundb/gun.svg)](https://microbadger.com/images/gundb/gun). Or:

```bash
docker run -p 8080:8080 gundb/gun
docker run -p 8765:8765 gundb/gun
```

Or build the [Docker](https://docs.docker.com/engine/installation/) image locally:
Expand All @@ -197,17 +197,17 @@ Or build the [Docker](https://docs.docker.com/engine/installation/) image locall
git clone https://github.com/amark/gun.git
cd gun
docker build -t myrepo/gundb:v1 .
docker run -p 8080:8080 myrepo/gundb:v1
docker run -p 8765:8765 myrepo/gundb:v1
```

Or, if you prefer your Docker image with metadata labels (Linux/Mac only):

```bash
npm run docker
docker run -p 8080:8080 username/gun:git
docker run -p 8765:8765 username/gun:git
```

Then visit [http://localhost:8080](http://localhost:8080) in your browser.
Then visit [http://localhost:8765](http://localhost:8765) in your browser.

## License

Expand Down
2 changes: 1 addition & 1 deletion examples/angular/server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8080;
var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8765;
var host = process.env.OPENSHIFT_NODEJS_HOST || process.env.VCAP_APP_HOST || process.env.HOST || 'localhost';

var express = require('express');
Expand Down
2 changes: 1 addition & 1 deletion examples/express.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
console.log("If module not found, install express globally `npm i express -g`!");
var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8080;
var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8765;
var express = require('express');
var Gun = require('..');

Expand Down
2 changes: 1 addition & 1 deletion examples/hapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Inert = require('inert')
const Gun = require('..')

const server = new Hapi.Server({
port: 8080,
port: 8765,
host: 'localhost',
routes: {
files: {
Expand Down
2 changes: 1 addition & 1 deletion examples/http-external-ws.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8080;
var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8765;

var Gun = require('../');

Expand Down
2 changes: 1 addition & 1 deletion examples/http.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8080 || 8765;
var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8765;

var Gun = require('../');

Expand Down
2 changes: 1 addition & 1 deletion examples/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ npm install gun
# to run the gun examples:
cd ./node_modules/gun
npm install .
sudo /usr/local/bin/node ./examples/http.js 80 # change `80` to `8080` for development purposes.
sudo /usr/local/bin/node ./examples/http.js 80 # change `80` to `8765` for development purposes.
4 changes: 2 additions & 2 deletions examples/react/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
console.log("If modules not found, run `npm install` in /example folder!");
var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8081;
var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8765;
var host = process.env.OPENSHIFT_NODEJS_HOST || process.env.VCAP_APP_HOST || process.env.HOST || 'localhost';

var express = require('express');
Expand All @@ -15,7 +15,7 @@ var gun = Gun({
});

app.use(Gun.serve);
app.use(proxy(host + ':8080'));
app.use(proxy(host + ':8765'));
server.listen(port);

console.log('Server started on port ' + port + ' with /gun');
4 changes: 2 additions & 2 deletions examples/social.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
;(() => {
function S(){};
window.S = S;
S.gun = Gun(location.host? location.origin+'/gun' : 'http://localhost:8080/gun');
//S.gun = Gun('http://localhost:8080/gun');
S.gun = Gun(location.host? location.origin+'/gun' : 'http://localhost:8765/gun');
//S.gun = Gun('http://localhost:8765/gun');
//S.gun = Gun();
S.app = S.gun.get('examples/social/1');
S.user = S.gun.user();
Expand Down
2 changes: 1 addition & 1 deletion examples/vue/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

/********************** SIMPLE NODE GUN SERVER EXAMPLE FOR BACKEND **********************/
// var http = require('http'), Gun = require('gun');
// Gun({ web: http.createServer().listen(8080) });
// Gun({ web: http.createServer().listen(8765) });

/********************** MODIFY WITH OUR OWN SERVER ADDRESS **********************/
// Vue.use(GunData, 'http://REPLACE.WITH.YOUR.GUN.SERVER:SERVERPORT/gun');
Expand Down
2 changes: 1 addition & 1 deletion lib/tmp.test.sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
test._.stack.push(fn);
return test;
}
var gun = window.gun = Gun(); //Gun('http://localhost:8080/gun');
var gun = window.gun = Gun();
window.SPAM = function(read){ // TODO: BUG? gun-sid in transport layer not correct?
//localStorage.clear();
var start = Gun.time.is();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"browser": "gun.min.js",
"scripts": {
"start": "node examples/http.js 8080",
"start": "node examples/http.js 8765",
"prepublishOnly": "npm run unbuild",
"test": "mocha",
"testsea": "mocha test/sea.js",
Expand Down
2 changes: 1 addition & 1 deletion test/debug/deep-set.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;(function(){
//localStorage.clear();

var gun = window.gun = Gun('http://localhost:8080/gun');
var gun = window.gun = Gun('http://localhost:8765/gun');
var user = window.user = gun.get('pub/alice');
return;
user.put({pub: 'alice'}, write);
Expand Down
3 changes: 1 addition & 2 deletions test/gun.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script src="../examples/jquery.js"></script>
<script src="../gun.js"></script>
<script src="../lib/open.js"></script>
<script>
var gun = Gun('http://localhost:8080/gun');
var gun = Gun('http://localhost:8765/gun');
</script>
2 changes: 1 addition & 1 deletion test/https/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function(port, file, cb, inject){
port = port || process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8080;
port = port || process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8765;

var fs = require('fs');
var Gun = require(__dirname+'/../../');
Expand Down
2 changes: 1 addition & 1 deletion test/panic/b2s2s2b.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 2,
browsers: 2,
each: 100000,
Expand Down
2 changes: 1 addition & 1 deletion test/panic/curl-server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 2,
dir: __dirname
}
Expand Down
6 changes: 3 additions & 3 deletions test/panic/e2e/distributed.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ describe('PANIC!', function(){

panic.server(server);
gun.wsp(server);
server.listen(8080);
server.listen(8765);

var clients = panic.clients;

var wd = require('selenium-webdriver');
var ff1 = new wd.Builder()
.forBrowser('firefox').build()
.get('http://localhost:8080/panic.html');
.get('http://localhost:8765/panic.html');
var ff2 = new wd.Builder()
.forBrowser('firefox').build()
.get('http://localhost:8080/panic.html');
.get('http://localhost:8765/panic.html');

function min(n, done, list){
list = list || clients;
Expand Down
2 changes: 1 addition & 1 deletion test/panic/e2e/holy/grail.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var bob = browsers.excluding(alice).pluck(1);

var serverPath = path.join(__dirname, 'gun-server.js');

// start the server on :8080
// start the server on :8765
spawn('node', [serverPath]);

function waitFor (num, list) {
Expand Down
2 changes: 1 addition & 1 deletion test/panic/e2e/holy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>
<body>
<script src='panic.js'></script>
<script src='http://localhost:8080/gun.js'></script>
<script src='http://localhost:8765/gun.js'></script>

<script>
(function () {
Expand Down
2 changes: 1 addition & 1 deletion test/panic/e2e/holy/ports.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"panic": 3000,
"gun": 8080
"gun": 8765
}
2 changes: 1 addition & 1 deletion test/panic/holy-grail.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 2,
browsers: 2,
route: {
Expand Down
2 changes: 1 addition & 1 deletion test/panic/load.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 1,
browsers: 4,
each: 1500,
Expand Down
2 changes: 1 addition & 1 deletion test/panic/radisk.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 2,
browsers: 3,
each: 1000000,
Expand Down
2 changes: 1 addition & 1 deletion test/panic/s2s-all-delayed-peer-add.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 2,
browsers: 0,
dir: __dirname,
Expand Down
2 changes: 1 addition & 1 deletion test/panic/s2s-all.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 2,
browsers: 0,
dir: __dirname,
Expand Down
2 changes: 1 addition & 1 deletion test/panic/scale.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 1,
browsers: 2,
each: 2500,
Expand Down
2 changes: 1 addition & 1 deletion test/panic/set.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 1,
browsers: 2,
route: {
Expand Down
2 changes: 1 addition & 1 deletion test/panic/speak.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 1,
browsers: 2,
each: 250,
Expand Down
2 changes: 1 addition & 1 deletion test/panic/users.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 2,
browsers: 2,
route: {
Expand Down
2 changes: 1 addition & 1 deletion test/panic/who.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var config = {
IP: require('ip').address(),
port: 8080,
port: 8765,
servers: 1,
browsers: 2,
route: {
Expand Down
2 changes: 1 addition & 1 deletion test/ptsd/spam.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var t;
}
}());

var gun = Gun({localStorage: false, peers: 'http://localhost:8080/gun'});
var gun = Gun({localStorage: false, peers: 'http://localhost:8765/gun'});
var g = gun.get('test');
var room = Gun.text.random(100);
var pub = Gun.text.random(1000);
Expand Down
4 changes: 2 additions & 2 deletions test/server/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ var gun = Gun({

var server = http.createServer(function(req, res){});
gun.wsp(server);
server.listen(8080);
server.listen(8765);

console.log('Server started on port ' + 8080 + ' with /gun');
console.log('Server started on port ' + 8765 + ' with /gun');
2 changes: 1 addition & 1 deletion test/server/node-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var Gun = require('../../index');

var location = {host:"localhost"};

var gun = Gun( { file: 'read.json', peers: ['http://' + location.host + ':8080/gun'] });
var gun = Gun( { file: 'read.json', peers: ['http://' + location.host + ':8765/gun'] });

gun.get( 'data' ).path('stuff').map(function(val,field){ console.log( field, "=", val ); } );

Expand Down
2 changes: 1 addition & 1 deletion test/server/node-write.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ var Gun = require('../../index');

var location = {host:"localhost"};

var gun = Gun( { file: 'write.json', peers: ['http://' + location.host + ':8080/gun'] });
var gun = Gun( { file: 'write.json', peers: ['http://' + location.host + ':8765/gun'] });

gun.get( 'data' ).path('stuff').put({a: {data: 1}, b: {data: 2}});
31 changes: 31 additions & 0 deletions test/tmp/bigsync.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var Gun = require('../../');

var data = require('fs').readFileSync('/Users/mark/Downloads/raddataformat.txt');

data = data.toString();
data += data + data;

console.log(data.length);

var gun = Gun('http://localhost:8080/gun');

setTimeout(function(){
console.log("SEND!");
gun.get('bigsync').get('raw').put(data);

/*var req = require('http').request({
host: 'localhost'
,port: '8080'
,method: 'POST'
}, function(res){
console.log("GOT REPLY!", res);
res.on('data', function(chunk){
console.log("!!!", chunk);
});
res.on('error', function(err){
console.log("ERROR", err);
})
});
req.write(data);
req.end();*/
}, 1000);
Loading

0 comments on commit d65e2c3

Please sign in to comment.