Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Jul 12, 2022
1 parent becc5f4 commit f1ece3f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/proxy-server.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as Logger from 'bunyan'
import { isWorker, worker } from 'cluster'
import { EventEmitter } from 'events'
import { createServer, Server, Socket } from 'net'
import { Container } from 'typedi'
import { Backend, IBackend } from './backend'
import { Client } from './client'
import { Config } from './config'
import { EnumHandShakeState } from './constants'
import { PluginHook } from './plugin-hook'
import {isWorker, worker} from 'cluster'
import {EventEmitter} from 'events'
import {createServer, Server, Socket} from 'net'
import {Container} from 'typedi'
import {Backend, IBackend} from './backend'
import {Client} from './client'
import {Config} from './config'
import {EnumHandShakeState} from './constants'
import {PluginHook} from './plugin-hook'

export class ProxyServer extends EventEmitter {
public clients: Set<Client> = new Set()
Expand All @@ -26,7 +26,7 @@ export class ProxyServer extends EventEmitter {
private host?: string,
) {
super()
const loggerOptions: Logger.LoggerOptions = { name: 'server', port, host }
const loggerOptions: Logger.LoggerOptions = {name: 'server', port, host}
if (isWorker) {
loggerOptions.worker = worker.id
}
Expand Down Expand Up @@ -70,14 +70,14 @@ export class ProxyServer extends EventEmitter {
private async onConnection(socket: Socket): Promise<void> {
if (this.isIpBanned(socket.remoteAddress)) {
socket.end()
this.logger.warn({ ip: socket.remoteAddress }, `block ip ${socket.remoteAddress}`)
this.logger.warn({ip: socket.remoteAddress}, `block ip ${socket.remoteAddress}`)
return
}
const client = new Client(socket, this)
this.clients.add(client)
socket.once('disconnect', () => this.onDisconnect(client))
socket.on('error', (err) => {
this.logger.error({ err })
this.logger.error({err})
})
try {
const nextState = await client.awaitHandshake()
Expand Down

0 comments on commit f1ece3f

Please sign in to comment.