Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
akka-irc
========

Forked from: https://github.com/mildlyskilled/akka-irc

A simple IRC-like client and server implementation in Scala and Akka. Thanks to the guys from LSUG for contributions to making it more Scala-esque.

How to run
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.network "forwarded_port", guest: 1099, host: 8080
config.vm.network :private_network, ip: "192.168.1.41"
config.vm.network :private_network, ip: "127.0.0.1"
config.vm.synced_folder ".", "/srv/irc", :owner => 'vagrant', :group => 'vagrant'
end
8 changes: 4 additions & 4 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ chatserver {
#take defaults from common configuration
include "common"
akka {
remote.netty.tcp {
hostname = "192.168.1.41"
remote.netty.ssl {
hostname = "10.90.0.57"
#hostname = "193.61.28.44" #(BBK LAN address )
#port = 1099 BBK Configuration
port = 1099
Expand All @@ -18,7 +18,7 @@ chatclient {
include "common"
akka {
# this would normally be overridden at run time
remote.netty.tcp.hostname="127.0.0.1" #allows us to hard code as well (?)
remote.netty.tcp.port = 2553
remote.netty.ssl.hostname="10.90.0.57" #allows us to hard code as well (?)
remote.netty.ssl.port = 2554
}
}
17 changes: 13 additions & 4 deletions src/main/resources/common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ akka {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
hostname = "127.0.0.1"
port = 1099
enabled-transports = ["akka.remote.netty.ssl"]
netty.ssl{
enable-ssl = true
security {
key-store = "src/main/resources/keystore"
key-store-password = "09040407050407080702010C0903090D0C0E0906"
key-password = "09040407050407080702010C0903090D0C0E0906"
trust-store = "src/main/resources/truststore"
trust-store-password = "09040407050407080702010C0903090D0C0E0906"
protocol = "TLSv1"
random-number-generator = "AES128CounterSecureRNG"
enabled-algorithms = ["TLS_RSA_WITH_AES_128_CBC_SHA"]
}
}
}
}
Binary file added src/main/resources/keystore
Binary file not shown.
Binary file added src/main/resources/truststore
Binary file not shown.
10 changes: 5 additions & 5 deletions src/main/scala/kaning/actors/Client.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object ChatClientApplication {
* in the actual IP address list found on this machine
*/
val clientconfig = ConfigFactory.load.getConfig("chatclient")
val ipaddressinconfig = clientconfig.getString("akka.remote.netty.tcp.hostname")
val ipaddressinconfig = clientconfig.getString("akka.remote.netty.ssl.hostname")

/**
* If the ip address in our configuration is also in the ip addresses in this "distilled"
Expand Down Expand Up @@ -76,7 +76,7 @@ object ChatClientApplication {
/**
* Apply the ip address to the configuration we will be using to construct the client actor
*/
val clientConfig = ConfigFactory.parseString(s"""akka.remote.netty.tcp.hostname="$ipAddress" """)
val clientConfig = ConfigFactory.parseString(s"""akka.remote.netty.ssl.hostname="$ipAddress" """)
val defaultConfig = ConfigFactory.load.getConfig("chatclient")
val completeConfig = clientConfig.withFallback(defaultConfig)

Expand All @@ -90,9 +90,9 @@ object ChatClientApplication {
* it from our nifty console input
*/
val serverconfig = ConfigFactory.load.getConfig("chatserver")
val serverAddress = serverconfig.getString("akka.remote.netty.tcp.hostname")
val serverPort = serverconfig.getString("akka.remote.netty.tcp.port")
val serverPath = s"akka.tcp://AkkaChat@$serverAddress:$serverPort/user/chatserver"
val serverAddress = serverconfig.getString("akka.remote.netty.ssl.hostname")
val serverPort = serverconfig.getString("akka.remote.netty.ssl.port")
val serverPath = s"akka.ssl.tcp://AkkaChat@$serverAddress:$serverPort/user/chatserver"
val server = system.actorSelection(serverPath) // <-- this is where we get the server reference

// NOW CONSTRUCT THE CLIENT using as a member of the system defined above
Expand Down