rename hostname to host (#74)
This commit is contained in:
parent
7c6439b301
commit
39659cf48b
23 changed files with 62 additions and 64 deletions
|
|
@ -4,7 +4,7 @@ const { ChunkColumn, Version } = require('bedrock-provider')
|
|||
|
||||
async function test () {
|
||||
const client = new Client({
|
||||
hostname: '127.0.0.1',
|
||||
host: '127.0.0.1',
|
||||
port: 19132
|
||||
// You can specify version by adding :
|
||||
// version: '1.16.210'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
const { createClient } = require('bedrock-protocol')
|
||||
|
||||
const client = createClient({ hostname: '127.0.0.1' })
|
||||
const client = createClient({ host: '127.0.0.1' })
|
||||
|
||||
let ix = 0
|
||||
client.on('packet', (args) => {
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ function createRelay () {
|
|||
console.log('Creating relay')
|
||||
/* Example to create a non-transparent proxy (or 'Relay') connection to destination server */
|
||||
const relay = new Relay({
|
||||
/* Hostname and port for clients to listen to */
|
||||
hostname: '0.0.0.0',
|
||||
/* host and port for clients to listen to */
|
||||
host: '0.0.0.0',
|
||||
port: 19130,
|
||||
/* Where to send upstream packets to */
|
||||
destination: {
|
||||
hostname: '127.0.0.1',
|
||||
host: '127.0.0.1',
|
||||
port: 19132
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ const { Relay } = require('bedrock-protocol')
|
|||
// Start the proxy server
|
||||
const relay = new Relay({
|
||||
version: '1.16.220', // The version
|
||||
/* Hostname and port to listen for clients on */
|
||||
hostname: '0.0.0.0',
|
||||
/* host and port to listen for clients on */
|
||||
host: '0.0.0.0',
|
||||
port: 19132,
|
||||
/* Where to send upstream packets to */
|
||||
destination: {
|
||||
hostname: '127.0.0.1',
|
||||
host: '127.0.0.1',
|
||||
port: 19131
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ async function startServer (version = '1.16.220', ok) {
|
|||
|
||||
const Item = require('../types/Item')(version)
|
||||
const port = 19132
|
||||
const server = new Server({ hostname: '0.0.0.0', port, version })
|
||||
const server = new Server({ host: '0.0.0.0', port, version })
|
||||
let loop
|
||||
|
||||
const getPath = (packetPath) => DataProvider(server.options.protocolVersion).getPath(packetPath)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class ClientProvider extends BotProvider {
|
|||
downKeys = new Set()
|
||||
|
||||
connect () {
|
||||
const client = new Client({ hostname: '127.0.0.1', version: '1.16.210', username: 'notch', offline: true, port: 19132, connectTimeout: 100000 })
|
||||
const client = new Client({ host: '127.0.0.1', version: '1.16.210', username: 'notch', offline: true, port: 19132, connectTimeout: 100000 })
|
||||
|
||||
client.once('resource_packs_info', (packet) => {
|
||||
client.write('resource_pack_client_response', {
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ class ProxyProvider extends BotProvider {
|
|||
|
||||
connect () {
|
||||
const proxy = new Relay({
|
||||
hostname: '0.0.0.0',
|
||||
host: '0.0.0.0',
|
||||
port: 19130,
|
||||
// logging: true,
|
||||
destination: {
|
||||
hostname: '127.0.0.1',
|
||||
host: '127.0.0.1',
|
||||
port: 19132
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue