all hardcore ips and ports moved to Main.kt
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import exceptions.RcControlException
|
||||
import net.server.handlers.AbstractHandler
|
||||
import net.server.handlers.flash.LoadBin
|
||||
import net.server.handlers.main.GetLocation
|
||||
@@ -17,6 +16,9 @@ val deltaTimeLocationRefresh: Int = 100//ms
|
||||
val serverPort: Int = 8888
|
||||
val serverIp: String = "127.0.0.1"
|
||||
|
||||
val mainServerAddress = "127.0.0.1"
|
||||
val mainServerPort = 7925
|
||||
|
||||
val protoBuf = require("protobufjs")
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package net
|
||||
|
||||
import require
|
||||
import mainServerAddress
|
||||
import mainServerPort
|
||||
|
||||
/**
|
||||
* Created by user on 7/28/16.
|
||||
@@ -9,8 +11,8 @@ val http = require("http")
|
||||
|
||||
fun sendRequest(dataBuffer: dynamic, url: String, successCallback: (responseData: ByteArray) -> Unit, errorCallback: (err: dynamic) -> Unit) {
|
||||
val options: dynamic = {}
|
||||
val serverAddress = "127.0.0.1"
|
||||
val port = 7925
|
||||
val serverAddress = mainServerAddress
|
||||
val port = mainServerPort
|
||||
js("options = {hostname:serverAddress, port:port, path:url, method:'POST'}")
|
||||
|
||||
val request = http.request(options, { response ->
|
||||
|
||||
@@ -8,7 +8,7 @@ import net.server.handlers.AbstractHandler
|
||||
* Created by user on 7/27/16.
|
||||
*/
|
||||
|
||||
fun start(handlers: MutableMap<String, AbstractHandler>, port:Int) {
|
||||
fun start(handlers: MutableMap<String, AbstractHandler>, port: Int) {
|
||||
val http = require("http")
|
||||
val url = require("url")
|
||||
http.createServer({ request, response ->
|
||||
|
||||
Reference in New Issue
Block a user